This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14042] C++ abstraction penalty is high in simple cases


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]