This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, i386]: Commited: Disable x87 register passing for now.
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 08 Dec 2006 19:33:08 +0100
- Subject: [PATCH, i386]: Commited: Disable x87 register passing for now.
Hello!
There is a problem exposed by the testcase from PR target/30120, where
unused registers were not handled properly in reg-stack.c
The solution for this problem is, that all registers that currently hold
values should be marked live at function entry.
However, there is a strange bug in reg-stack.c; for some reason stack
handling code segfaults on this change.
As I consider this bug to be very dangerous, I have comitted the patch
that (for now) disables x87 register passing functionality by setting
X87_REGPARM_MAX to 0. Patch was bootstrapped on i686-pc-linux-gnu and
regression tested for c, c++ and fortran.
2006-12-08 Uros Bizjak <ubizjak@gmail.com>
PR target/30120
* reg-stack.c (convert_regs_entry): Mark current argument passing
registers as live.
* config/i386/i386.h (X87_REGPARM_MAX): Set to 0 to disable passing
of float arguments in x87 registers.
testsuite/ChangeLog:
2006-12-08 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/x87regparm-1.c: XFAIL.
* gcc.target/i386/x87regparm-2.c: XFAIL.
* gcc.target/i386/x87regparm-3.c: XFAIL.
* gcc.target/i386/x87regparm-4.c: XFAIL.
Uros.
Index: testsuite/gcc.target/i386/x87regparm-2.c
===================================================================
--- testsuite/gcc.target/i386/x87regparm-2.c (revision 119661)
+++ testsuite/gcc.target/i386/x87regparm-2.c (working copy)
@@ -19,4 +19,4 @@
/* Check that no memory is used to pass arguments. */
-/* { dg-final { scan-assembler-not "\\(%esp\\)" } } */
+/* { dg-final { scan-assembler-not "\\(%esp\\)" { xfail *-*-* } } } */
Index: testsuite/gcc.target/i386/x87regparm-3.c
===================================================================
--- testsuite/gcc.target/i386/x87regparm-3.c (revision 119661)
+++ testsuite/gcc.target/i386/x87regparm-3.c (working copy)
@@ -19,4 +19,4 @@
/* Check that float and double arguments are passed through memory. */
-/* { dg-final { scan-assembler-times "\\(%esp\\)" 4 } } */
+/* { dg-final { scan-assembler-times "\\(%esp\\)" 4 { xfail *-*-* } } } */
Index: testsuite/gcc.target/i386/x87regparm-4.c
===================================================================
--- testsuite/gcc.target/i386/x87regparm-4.c (revision 119661)
+++ testsuite/gcc.target/i386/x87regparm-4.c (working copy)
@@ -19,4 +19,4 @@
/* Check that no memory is used to pass arguments. */
-/* { dg-final { scan-assembler-not "\\(%esp\\)" } } */
+/* { dg-final { scan-assembler-not "\\(%esp\\)" { xfail *-*-* } } } */
Index: testsuite/gcc.target/i386/x87regparm-1.c
===================================================================
--- testsuite/gcc.target/i386/x87regparm-1.c (revision 119661)
+++ testsuite/gcc.target/i386/x87regparm-1.c (working copy)
@@ -19,4 +19,4 @@
/* Check that no memory is used to pass arguments. */
-/* { dg-final { scan-assembler-not "\\(%esp\\)" } } */
+/* { dg-final { scan-assembler-not "\\(%esp\\)" { xfail *-*-* } } } */
Index: reg-stack.c
===================================================================
--- reg-stack.c (revision 119661)
+++ reg-stack.c (working copy)
@@ -2595,7 +2595,8 @@
int reg, top = -1;
for (reg = LAST_STACK_REG; reg >= FIRST_STACK_REG; --reg)
- if (TEST_HARD_REG_BIT (bi->stack_in.reg_set, reg))
+ if (TEST_HARD_REG_BIT (bi->stack_in.reg_set, reg)
+ || TEST_HARD_REG_BIT (incoming_regs, reg))
{
rtx init;
Index: config/i386/i386.h
===================================================================
--- config/i386/i386.h (revision 119661)
+++ config/i386/i386.h (working copy)
@@ -1778,7 +1778,9 @@
#define REGPARM_MAX (TARGET_64BIT ? 6 : 3)
-#define X87_REGPARM_MAX 3
+/* ??? Currently disabled, as reg-stack.c does not know how to
+ rearrange input registers if some arguments are left unused. */
+#define X87_REGPARM_MAX 0
#define SSE_REGPARM_MAX (TARGET_64BIT ? 8 : (TARGET_SSE ? 3 : 0))