This is the mail archive of the gcc-patches@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]

yet another i386 print_reg patch


Cures a crash with (reg:QI dirflag).

QImode must be valid for *any* register, since (clobber (reg:QI x))
is what's generated for extended asm clobbers.


r~


        * config/i386/i386.c (print_reg): Handle QI and HI modes for
        non Q regs.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.425.2.38
diff -u -p -r1.425.2.38 i386.c
--- i386.c	13 Nov 2003 02:38:24 -0000	1.425.2.38
+++ i386.c	19 Nov 2003 07:55:51 -0000
@@ -7072,12 +7072,17 @@ print_reg (rtx x, int code, FILE *file)
       /* FALLTHRU */
     case 16:
     case 2:
+    normal:
       fputs (hi_reg_name[REGNO (x)], file);
       break;
     case 1:
+      if (REGNO (x) >= ARRAY_SIZE (qi_reg_name))
+	goto normal;
       fputs (qi_reg_name[REGNO (x)], file);
       break;
     case 0:
+      if (REGNO (x) >= ARRAY_SIZE (qi_high_reg_name))
+	goto normal;
       fputs (qi_high_reg_name[REGNO (x)], file);
       break;
     default:


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