[Bug rtl-optimization/59857] 4.8.2 loop optimization is worse than 4.5.1 under ARM
rearnsha at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 17 15:42:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59857
--- Comment #2 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
My suspicion is that ulv is short-hand for unsigned long volatile -- since
without it this testcase is completely degenerate: val isn't used at all, so
when ulv is not volatile, then entire function reduces to 'return 10;'
The difference between the output when ulv is volatile is then down to
no-longer using post-increment operations on volatile memory accesses. I
suspect this was done to fix problems we've had with incorrect optimizations of
volatile operations.
I think we've seen similar bug reports to this in the past. GCC is *very*
conservative when dealing with volatile objects, so I'm not surprised we don't
do this optimization.
More information about the Gcc-bugs
mailing list