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, i386]: Committed: Fix PR target/31768, Invalid code or ICE for %z constraint


Hello!

This bug is again due to use of %z constraint in asm. When operand with legth 2 is memory operand (FP operators with HImode operands) gcc should emit "s", but for register operands, it should emit "w".

Attached patch fixes this problem. Patch was bootstrapped on x86_64-pc-linux-gnu and regression tested for all default languages (using -m32).

2007-05-03 Uros Bizjak <ubizjak@gmail.com>

       PR target/31768
       * config/i386/i386.c (print_operand) ['z']: Output 'w' for
       operands of size 2 when operand is not MEM_P.

Uros.
Index: i386.c
===================================================================
--- i386.c	(revision 124373)
+++ i386.c	(working copy)
@@ -8372,9 +8372,15 @@
 	      return;
 
 	    case 2:
+	      if (MEM_P (x))
+		{
 #ifdef HAVE_GAS_FILDS_FISTS
-	      putc ('s', file);
+		  putc ('s', file);
 #endif
+		  return;
+		}
+	      else
+		putc ('w', file);
 	      return;
 
 	    case 4:

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