DECL_RESULT, not the mode of DECL_RESULT itself.
* semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
for functions that used named return values.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31092
138bc75d-0d04-0410-961f-
82ee72b054a4
+1999-12-26 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (store_return_init): Use mode of old RTL generated for
+ DECL_RESULT, not the mode of DECL_RESULT itself.
+ * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
+ for functions that used named return values.
+
1999-12-24 Mark Mitchell <mark@codesourcery.com>
* semantics.c (expand_body): Use
if (DECL_REGISTER (decl))
{
original_result_rtx = DECL_RTL (decl);
- DECL_RTL (decl) = gen_reg_rtx (DECL_MODE (decl));
+ /* Note that the mode of the old DECL_RTL may be wider than the
+ mode of DECL_RESULT, depending on the calling conventions for
+ the processor. For example, on the Alpha, a 32-bit integer
+ is returned in a DImode register -- the DECL_RESULT has
+ SImode but the DECL_RTL for the DECL_RESULT has DImode. So,
+ here, we use the mode the back-end has already assigned for
+ the return value. */
+ DECL_RTL (decl) = gen_reg_rtx (GET_MODE (original_result_rtx));
}
}
store_return_init (decl);
}
}
+
+ /* Don't use tree-inlining for functions with named return values.
+ That doesn't work properly because we don't do any translation of
+ the RETURN_INITs when they are copied. */
+ DECL_UNINLINABLE (current_function_decl) = 1;
}
/* Cache the value of this class's main virtual function table pointer
+// Build don't link:
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
// distilled from libg++'s Rational.cc
// Special g++ Options:
-// crash test - XFAIL sparc64*-*-* sparcv9*-*-* alpha*-*-*
inline int bar () return r {}
+// Build don't link:
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
int& foo (int& x) {
bar ();
return x;
-} // gets bogus error - XFAIL *-*-*
+}