This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49338] wrong code with -O2 and -O3
- From: "hsmeier at arcor dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 08:42:32 +0000
- Subject: [Bug c++/49338] wrong code with -O2 and -O3
- Auto-submitted: auto-generated
- References: <bug-49338-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49338
--- Comment #4 from Hans Meier <hsmeier at arcor dot de> 2011-06-09 08:42:31 UTC ---
(In reply to comment #2)
> is an obvious aliasing violation.
yes, but why does this lead to read from other objects than it is intended? -
The "[1..1]" comes from m_ppSelect[i] when reading m_ppUpperLimit[i] and
m_ppLowerLimit[i], if we change Select to 0 the range also changes to [0..0]
etc.
btw: this code sequence in our software is called about 10 million times per
second from more than 1000 occurrences in 100 classes and only in this singe
constellation it doesn't work. Considering these figures it is THE hotspot for
performance optimization and this is the fastest implementation I could find
within weeks of experimenting.