[Bug tree-optimization/59875] Missed unrolling opportunity

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 19 09:09:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59875

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-19
            Summary|Weak symbols in glibc       |Missed unrolling
                   |prevent optimizations       |opportunity
     Ever confirmed|0                           |1
           Severity|trivial                     |normal

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
(note that your new/delete prototypes are the C++03 ones, you should change
them for C++11)

I don't think it has anything to do with glibc or weak. If I patch
tree-ssa-loop-ivcanon.c (couldn't find a sufficient option or parameter) to
convince the compiler that it is ok to unroll the loop although it isn't an
inner loop and it contains calls on the "hot" path, it manages to optimize foo
to nothing.

gcc-4.4 (if we tweak the example so it compiles) did unroll the loop, but only
optimized away the test for the last element of the array.

It would also be possible for the compiler to notice that all array elements
are the same and thus any access (in range) will yield the same value, but that
seems more specialized.



More information about the Gcc-bugs mailing list