This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Re: m68k bootstrap failure
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Gunther Nikl <gni at gecko dot de>
- Cc: Bernardo Innocenti <bernie at develer dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Oct 2003 14:46:31 -0800
- Subject: [PATCH] Re: m68k bootstrap failure
- References: <3F9C505B.6080703@develer.com><20031027171359.GA11774@lorien.int.gecko.de><20031028143152.GA39589@lorien.int.gecko.de>
Gunther Nikl <gni@gecko.de> writes:
> Hello!
>
> Your patch http://gcc.gnu.org/ml/gcc-patches/2003-10/msg02274.html changing
> genmodes.c/machmode.h breaks m68k when using FPU mode. A testcase can be
> found here: http://gcc.gnu.org/ml/gcc/2003-10/msg01317.html.
It took me an appallingly long time to track this down, but it turns
out to be because I accidentally changed what GET_MODE_NUNITS returns
for scalar modes, which caused HARD_REGNO_NREGS to return 0 for
floating point registers. The appended patch should fix it. Please
test it and let me know if it works.
zw
* genmodes.c (complete_mode): Record MODE_CC, MODE_INT,
MODE_FLOAT, and MODE_PARTIAL_INT modes as having one
component, not zero.
===================================================================
Index: genmodes.c
--- genmodes.c 25 Oct 2003 02:03:33 -0000 1.7
+++ genmodes.c 28 Oct 2003 22:43:29 -0000
@@ -316,7 +316,7 @@ complete_mode (struct mode_data *m)
validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
m->bytesize = 4;
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0;
break;
@@ -328,7 +328,7 @@ complete_mode (struct mode_data *m)
validate_mode (m, OPTIONAL, SET, UNSET, UNSET,
m->class == MODE_FLOAT ? SET : UNSET);
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0;
break;
@@ -340,7 +340,7 @@ complete_mode (struct mode_data *m)
m->bytesize = m->component->bytesize;
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0; /* ??? preserve this */
break;