This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
reg-stack fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: reg-stack fix
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 19 Oct 1999 02:09:28 -0600
- Reply-To: law at cygnus dot com
A slight variation on HJ's patch. Mostly to avoid even the potential of
doing something stupid of the return type is an aggregate. Plus some
comments. I also added a test for this bug to the testsuite.
* reg-stack.c (stack_result): Aggregates are not returned in
stack registers.
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reg-stack.c,v
retrieving revision 1.31.4.2
diff -c -3 -p -r1.31.4.2 reg-stack.c
*** reg-stack.c 1999/08/07 05:58:29 1.31.4.2
--- reg-stack.c 1999/10/19 08:04:01
*************** static rtx
*** 1186,1193 ****
stack_result (decl)
tree decl;
{
! rtx result = DECL_RTL (DECL_RESULT (decl));
if (result != 0
&& ! (GET_CODE (result) == REG
&& REGNO (result) < FIRST_PSEUDO_REGISTER))
--- 1186,1201 ----
stack_result (decl)
tree decl;
{
! rtx result;
+ /* If the value is supposed to be returned in memory, then clearly
+ it is not returned in a stack register. */
+ if (aggregate_value_p (DECL_RESULT (decl)))
+ return 0;
+
+ result = DECL_RTL (DECL_RESULT (decl));
+ /* ?!? What is this code supposed to do? Can this code actually
+ trigger if we kick out aggregates above? */
if (result != 0
&& ! (GET_CODE (result) == REG
&& REGNO (result) < FIRST_PSEUDO_REGISTER))