This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: always use pseudo return regs
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: always use pseudo return regs
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 23 May 2001 15:58:10 -0700
- References: <20010523000858.A22285@redhat.com>
On Wed, May 23, 2001 at 12:08:58AM -0700, Richard Henderson wrote:
> * function.c (expand_function_start): Always use a pseudo
> for the function result value.
"All bugs are producable with a powerpc cross."
-- geoffk
Alpha didn't see this because complex values smaller than word mode
prevent inlining. Bother. Fixes execute/complex-5.c and friends.
r~
* integrate.c (expand_inline_function): Handle CONCAT DECL_RESULT.
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.144
diff -c -p -d -r1.144 integrate.c
*** integrate.c 2001/05/17 21:21:21 1.144
--- integrate.c 2001/05/23 22:51:19
*************** expand_inline_function (fndecl, parms, t
*** 1083,1088 ****
--- 1083,1113 ----
else
map->reg_map[REGNO (loc)] = reg_to_map;
}
+ else if (GET_CODE (loc) == CONCAT)
+ {
+ enum machine_mode departing_mode = TYPE_MODE (type);
+ enum machine_mode arriving_mode
+ = GET_MODE (DECL_RTL (DECL_RESULT (fndecl)));
+
+ if (departing_mode != arriving_mode)
+ abort ();
+ if (GET_CODE (XEXP (loc, 0)) != REG
+ || GET_CODE (XEXP (loc, 1)) != REG)
+ abort ();
+
+ /* Don't use MEMs as direct targets because on some machines
+ substituting a MEM for a REG makes invalid insns.
+ Let the combiner substitute the MEM if that is valid. */
+ if (target == 0 || GET_CODE (target) != REG
+ || GET_MODE (target) != departing_mode)
+ target = gen_reg_rtx (departing_mode);
+
+ if (GET_CODE (target) != CONCAT)
+ abort ();
+
+ map->reg_map[REGNO (XEXP (loc, 0))] = XEXP (target, 0);
+ map->reg_map[REGNO (XEXP (loc, 1))] = XEXP (target, 1);
+ }
else
abort ();