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 middle-end/28831] [4.0/4.1/4.2 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter



------- Comment #3 from guillaume dot melquiond at ens-lyon dot fr  2006-08-25 08:34 -------
> Which looks ok if we are passing via value but since we need to pass by
> reference, the middle-end thinks we need a new stack space for it because it
> does not know that D.1992 is not used after the call to g.

Isn't it the other way around? There is no problem if we are passing by
reference, as the code then looks like "g (&D.1992);". The middle-end will not
do any copy. But, because we are passing by value, D.1992 is copied into the
stack frame instead. I understand your point about the middle-end having to
ensure that D.1992 is not used after g in order to store it directly into the
stack frame of g. But isn't this information already available to the
middle-end?


-- 


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


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