https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101824
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:3f29e301f299a1b4e2c535affb964f0b97b7639c commit r11-8964-g3f29e301f299a1b4e2c535affb964f0b97b7639c Author: Richard Biener <rguent...@suse.de> Date: Mon Aug 9 10:19:10 2021 +0200 middle-end/101824 - properly handle volatiles in nested fn lowering When we build the COMPONENT_REF of a formerly volatile local off the FRAME decl we have to make sure to mark the COMPONENT_REF as TREE_THIS_VOLATILE. While the GIMPLE operand scanner looks at the FIELD_DECL this is not how volatile GENERIC refs work. 2021-08-09 Richard Biener <rguent...@suse.de> PR middle-end/101824 * tree-nested.c (get_frame_field): Mark the COMPONENT_REF as volatile in case the variable was. * gcc.dg/tree-ssa/pr101824.c: New testcase. (cherry picked from commit bb169406cdc9e044eaec500dd742c2fed40f5488)