This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59875] Missed unrolling opportunity
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Jan 2014 09:09:47 +0000
- Subject: [Bug tree-optimization/59875] Missed unrolling opportunity
- Auto-submitted: auto-generated
- References: <bug-59875-4 at http dot gcc dot gnu dot org/bugzilla/>
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.