This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14042] C++ abstraction penalty is high in simple cases
- From: "tjw at omnigroup dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2004 16:57:05 -0000
- Subject: [Bug optimization/14042] C++ abstraction penalty is high in simple cases
- References: <20040206074537.14042.tjw@omnigroup.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tjw at omnigroup dot com 2004-02-06 16:57 -------
s1 and s2 are different objects since they are on the stack. 'inS1' and 'inS2' could be the same
object since they are passed by reference, but that is immaterial here since they are copied into the
stack allocated objects and then written over with the results after the loop. That is, inside the
loop, only stack allocated objects are used and it should be easy to prove that they are not the
same object.
Maybe you are saying that the compiler doesn't currently keep track of whether they are different
objects?
Also, I believe this bug persists if you change the signature to:
void iterate_bad(State inS1, State inS2, unsigned int n)
... and what is even more interesting is that even though the function doesn't produce any useful
work once that is done (assuming inlining takes effect) and the whole function could be replaced by
a 'blr', it isn't (I think I only tried this on 3.4, YMMV on tree-ssa).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14042