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 rtl-optimization/44194] struct returned by value generates useless stores


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

--- Comment #36 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-06-22 07:57:28 UTC ---
> There is a comment in calls.c that says
>        /* Handle calls that return values in multiple non-contiguous locations.
>      The Irix 6 ABI has examples of this.  */
> 
> I don't know if avoiding the copy breaks that ABI in any way so I didn't try
> that approach. In general, if the TARGET is non-NULL, I don't see how the copy
> can be avoided (but then, the tree EXPR corresponding to the target hopefully
> has the addressable flag set). In this particular case though TARGET is NULL.
> Is it just a matter of setting  VALREG  and let expand_assignment deal with it?

It isn't a matter of avoiding the copy, it is matter of avoiding to spill the
copy to memory if possible, i.e. to copy to pseudo registers instead.  There
may be prerequisites.  See comment #22 for a possible approach.

> Irrespective of how this case is handled, I think there may be other instances
> where a store generated during expansion may be redundant, but we don't know it
> at the point of generation. In such cases, is this approach of associating a
> tree expr with the temp rtx generated by the expanded reasonable?

Probably, yes, albeit as a last resort solution.


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