This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Re: m68k bootstrap failure


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;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]