https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120400
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #8) > (In reply to Andrew Pinski from comment #7) > > I think if you set TREE_SIDE_EFFECTS on the decls that have a D_V_E, then it > > might just work. > > i can also try that (but I'd want to avoid doing something that's possibly > fragile). > > note that: > > int foo (bool *a) > { > if (a && !*a) > return 6; > return 42; > } > > behaves as expected. Right because INDIRECT_REF has TREE_SIDE_EFFECTS set on it when it is built.