+2005-11-11 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/24445
+ * calls.c (expand_call): Copy a return value to a plain register
+ if needed.
+
2005-11-10 Alexandre Oliva <aoliva@redhat.com>
PR target/24778
&& GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp))
&& GET_MODE (target) == GET_MODE (valreg))
{
+ /* We have to copy a return value in a CLASS_LIKELY_SPILLED hard
+ reg to a plain register. */
+ if (REG_P (valreg)
+ && HARD_REGISTER_P (valreg)
+ && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (valreg)))
+ && !(REG_P (target) && !HARD_REGISTER_P (target)))
+ valreg = copy_to_reg (valreg);
+
/* TARGET and VALREG cannot be equal at this point because the
latter would not have REG_FUNCTION_VALUE_P true, while the
former would if it were referring to the same register.
--- /dev/null
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O1 -fpic" } */
+extern int bar (void) __attribute__ ((__pure__));
+extern char *baz;
+void
+foo (void)
+{
+ baz = (char *) bar ();
+}