https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96018

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
So on trunk I get with -O2 (with or without -fno-inline)

> ./a.out 
write text
write text
 3d works
write text
 4d does not

and with -O0

> ./a.out 
write text
write text
 3d works
write text
write text
 4d does not

where write_4d is optimized to

write_4d ()
{
  <bb 2> [local count: 1073741824]:
  # .MEM_22 = VDEF <.MEM_1(D)>
  call_side_effect (); [tail call]
  # VUSE <.MEM_22>
  return;

}

the interesting fact is that inner_4d is computed "pure" (no side-effects)
while inner_3d is not and this is so from the start so done by the FE.

Reply via email to