x86 SSE2 inline function compilation failures at -O0

Jan Beulich JBeulich@novell.com
Thu Jul 8 14:15:00 GMT 2004


This fixes some of the problems uncovered by the previously sent ix86
MMX/SSE testsuite additions.

Jan

2004-07-08 Jan Beulich <jbeulich@novell.com>

	* config(i386/i386.c (ix86_expand_binop_builtin): Widen
conditions to
	force target and op0 to a register.
	(ix86_expand_unop_builtin): Widen conditions to force target to
a
	register.
	(ix86_expand_builtin, case IX86_BUILTIN_LOAD[HL]P[SD]): Dito.
	(ix86_expand_builtin, case IX86_BUILTIN_STORE[HL]P[SD]): Widen
	conditions to force op1 to a register.

---
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/config/i386/i386.c	2004-07-02
15:20:42.000000000 +0200
+++ 2004-07-05.10.09/gcc/config/i386/i386.c	2004-07-07
15:34:34.093686264 +0200
@@ -13685,7 +13685,8 @@
 
   if (! target
       || GET_MODE (target) != tmode
-      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+      || ! (*insn_data[icode].operand[0].predicate) (target, tmode)
+      || (GET_CODE (target) == MEM && ! rtx_equal_p (target, op0)))
     target = gen_reg_rtx (tmode);
 
   if (GET_MODE (op1) == SImode && mode1 == TImode)
@@ -13701,7 +13702,8 @@
       || (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode))
     abort ();
 
-  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+  if ((GET_CODE (op0) == MEM && ! rtx_equal_p (target, op0))
+      || ! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
   if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
@@ -13758,7 +13760,8 @@
 
   if (! target
       || GET_MODE (target) != tmode
-      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+      || ! (*insn_data[icode].operand[0].predicate) (target, tmode)
+      || (do_load && GET_CODE (target) == MEM))
     target = gen_reg_rtx (tmode);
   if (do_load)
     op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
@@ -14083,12 +14086,12 @@
       mode0 = insn_data[icode].operand[1].mode;
       mode1 = insn_data[icode].operand[2].mode;
 
-      if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+      if (GET_CODE (op0) == MEM)
 	op0 = copy_to_mode_reg (mode0, op0);
       op1 = gen_rtx_MEM (mode1, copy_to_mode_reg (Pmode, op1));
       if (target == 0
 	  || GET_MODE (target) != tmode
-	  || ! (*insn_data[icode].operand[0].predicate) (target,
tmode))
+	  || GET_CODE (target) == MEM)
 	target = gen_reg_rtx (tmode);
       pat = GEN_FCN (icode) (target, op0, op1);
       if (! pat)
@@ -14112,7 +14115,7 @@
       mode1 = insn_data[icode].operand[2].mode;
 
       op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
-      if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
+      if (GET_CODE (op1) == MEM)
 	op1 = copy_to_mode_reg (mode1, op1);
 
       pat = GEN_FCN (icode) (op0, op0, op1);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-mainline-x86-expand-builtins.patch
Type: application/octet-stream
Size: 2847 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040708/cca873dd/attachment.obj>


More information about the Gcc-patches mailing list