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]

[patch] h8300.c: Fix PR/13721.


Hi,

Attached is a patch to fix(?) PR/13721.

If one uses a machinde-dependent operand character in a way
inconsistent with the corresponding constraint in an inline asm
statement, h8300-elf-gcc may segfault.

The patch changes that to ICE, which says where the error occurs at
least.

Built h8300-elf.  Committed to both mainline and 3.4 branch.

Kazu Hirata

2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>

	PR target/13721
	* config/h8300/h8300.c (byte_reg): Call abort() if asked to
	print a operand other than a register.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.272
diff -u -r1.272 h8300.c
--- h8300.c	8 Feb 2004 23:08:39 -0000	1.272
+++ h8300.c	9 Feb 2004 17:16:54 -0000
@@ -338,6 +338,9 @@
     "r4l", "r4h", "r5l", "r5h", "r6l", "r6h", "r7l", "r7h"
   };
 
+  if (!REG_P (x))
+    abort ();
+
   return names_small[REGNO (x) * 2 + b];
 }
 


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