https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102285
--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 1 Oct 2021, qing.zhao at oracle dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102285 > > --- Comment #16 from Qing Zhao <qing.zhao at oracle dot com> --- > > On Oct 1, 2021, at 1:51 AM, rguenth at gcc dot gnu.org > > <gcc-bugzi...@gcc.gnu.org> wrote: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102285 > > > > --- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> --- > > Because the variable doesn't need to be addressable. > > One question: > > For the following statement in the routine “fold_builtin_alloca_with_align” in > tree-ssa-ccp.c: > > > /* Fold alloca to the address of the array. */ > return fold_convert (TREE_TYPE (lhs), build_fold_addr_expr (var)); > > Clearly, we build a add_expr for “var”, but why not “mark_addressable” for > “var” since its address is taken? The address will be propagated and the operand scanner will mark it addressable when it ends in a context where it needs to be.