------- Comment #12 from bonzini at gnu dot org  2009-08-05 23:09 -------
Created an attachment (id=18309)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18309&action=view)
another patch

This failure is related to NRV, which is why there is no C failure.

If I take care of it the patch is actually nicer because there's no distinction
between RESULT_DECL and PARM_DECL.  for_return == 2 now means simply "the
register in/from which a PARM_DECL/RESULT_DECL is copied".

This means that the only code that needs to special case promote_function_mode
is code copying from parameter registers (calls.c) and into the result
(expand_value_return in stmt.c).  I checked the pre-patch code and everybody
else used to guard the call to promote_mode(..., 1) with a call to the
promote_args/promote_return hook; this means that now they can call
promote_function_mode with a final argument that is 0 or 1.

BTW here is a minimal testcase:

struct A
{
  A (const A & __str);
  A (const char * __s);
};
struct B
{
  virtual A a (void) const { return A ("hi"); }
};
const B b;


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #18304|0                           |1
        is obsolete|                            |


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

Reply via email to