This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/59857] 4.8.2 loop optimization is worse than 4.5.1 under ARM
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jan 2014 15:41:56 +0000
- Subject: [Bug rtl-optimization/59857] 4.8.2 loop optimization is worse than 4.5.1 under ARM
- Auto-submitted: auto-generated
- References: <bug-59857-4 at http dot gcc dot gnu dot org/bugzilla/>
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.