]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/32389 (ICE in extract_constrain_insn_cached when using -msse)
authorUros Bizjak <ubizjak@gmail.com>
Thu, 21 Jun 2007 07:13:16 +0000 (09:13 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 21 Jun 2007 07:13:16 +0000 (09:13 +0200)
        PR target/32389
        * config/i386/i386.h (enum ix86_stack_slot): Add SLOT_VIRTUAL.
        * config/i386/i386.c (assign_386_stack_local): Assert that
        SLOT_VIRTUAL is valid only before virtual regs are instantiated.
        (ix86_expand_builtin) [IX86_BUILTIN_LDMXCSR, IX86_BUILTIN_STMXCSR]:
        Use SLOT_VIRTUAL stack slot instead of SLOT_TEMP.
        * config/i386/i386.md (truncdfsf2, truncxfsf2, truncxfdf2): Ditto.

testsuite/ChangeLog:

        PR target/32389
        * gcc.target/i386/pr32389.c New test.

From-SVN: r125912

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr32389.c [new file with mode: 0644]

index b393404709397baa65d745991baab7381497908d..b6781bf96515da9c1436d62d1e43a8d8d8f07b0a 100644 (file)
@@ -1,3 +1,13 @@
+2007-06-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/32389
+       * config/i386/i386.h (enum ix86_stack_slot): Add SLOT_VIRTUAL.
+       * config/i386/i386.c (assign_386_stack_local): Assert that
+       SLOT_VIRTUAL is valid only before virtual regs are instantiated.
+       (ix86_expand_builtin) [IX86_BUILTIN_LDMXCSR, IX86_BUILTIN_STMXCSR]:
+       Use SLOT_VIRTUAL stack slot instead of SLOT_TEMP.
+       * config/i386/i386.md (truncdfsf2, truncxfsf2, truncxfdf2): Ditto.
+
 2007-06-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR inline-asm/32109
index 646b404ef1845c90a3096c50933a3b659e23c645..af43c4761db4ed145146165660931e323561ed4f 100644 (file)
@@ -12865,6 +12865,9 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
 
   gcc_assert (n < MAX_386_STACK_LOCALS);
 
+  /* Virtual slot is valid only before vregs are instantiated.  */
+  gcc_assert ((n == SLOT_VIRTUAL) == !virtuals_instantiated);
+
   for (s = ix86_stack_locals; s; s = s->next)
     if (s->mode == mode && s->n == n)
       return s->rtl;
@@ -15494,13 +15497,13 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 
     case IX86_BUILTIN_LDMXCSR:
       op0 = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0);
-      target = assign_386_stack_local (SImode, SLOT_TEMP);
+      target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
       emit_move_insn (target, op0);
       emit_insn (gen_sse_ldmxcsr (target));
       return 0;
 
     case IX86_BUILTIN_STMXCSR:
-      target = assign_386_stack_local (SImode, SLOT_TEMP);
+      target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
       emit_insn (gen_sse_stmxcsr (target));
       return copy_to_mode_reg (SImode, target);
 
index 15e3f429500e0ec24cdf15baee2a2a87ac694304..737fae71aafcf28a182e1a8fd65390724f15689b 100644 (file)
@@ -2206,7 +2206,8 @@ enum ix86_entity
 
 enum ix86_stack_slot 
 {
-  SLOT_TEMP = 0,
+  SLOT_VIRTUAL = 0,
+  SLOT_TEMP,
   SLOT_CW_STORED,
   SLOT_CW_TRUNC,
   SLOT_CW_FLOOR,
index 6350b5018137a88b58145b92495d0f946ab86842..4ba032704983d086d36205c5133d821bf68d4c73 100644 (file)
     ;
   else
     {
-      rtx temp = assign_386_stack_local (SFmode, SLOT_TEMP);
+      rtx temp = assign_386_stack_local (SFmode, SLOT_VIRTUAL);
       emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp));
       DONE;
     }
       DONE;
     }
   else
-    operands[2] = assign_386_stack_local (SFmode, SLOT_TEMP);
+    operands[2] = assign_386_stack_local (SFmode, SLOT_VIRTUAL);
 })
 
 (define_insn "*truncxfsf2_mixed"
       DONE;
     }
   else
-    operands[2] = assign_386_stack_local (DFmode, SLOT_TEMP);
+    operands[2] = assign_386_stack_local (DFmode, SLOT_VIRTUAL);
 })
 
 (define_insn "*truncxfdf2_mixed"
index 604970b1432fb1631a2f53df147e6a3d0fb461f0..208e276029e50b5f811808bc7070486adf1b57da 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-21  Uros Bizjak  <ubizjak@gmail.com>
+       PR target/32389
+       * gcc.target/i386/pr32389.c New test.
+
 2007-06-20  Dirk Mueller  <dmueller@suse.de>
 
        PR c++/31806
diff --git a/gcc/testsuite/gcc.target/i386/pr32389.c b/gcc/testsuite/gcc.target/i386/pr32389.c
new file mode 100644 (file)
index 0000000..3f4cb3e
--- /dev/null
@@ -0,0 +1,10 @@
+/* Testcase by Mike Frysinger <vapier@gentoo.org>  */
+
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-msse" } */
+
+double f1();
+int f2() {
+  __builtin_ia32_stmxcsr();
+  return f1();
+}