re PR target/27266 (syncronization primitives cause ICE with -march=pentium or better)
authorKazu Hirata <kazu@codesourcery.com>
Mon, 22 May 2006 17:55:53 +0000 (17:55 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 22 May 2006 17:55:53 +0000 (17:55 +0000)
gcc/
PR target/27266
* config/i386/i386.c (ix86_expand_branch): Jump to simple if
ix86_compare_emitted is non-NULL.

gcc/testsuite/
PR target/27266
* gcc.target/i386/pr27266.c: New.

From-SVN: r113987

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

index 5ae866d..2d8c8ea 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-22  Kazu Hirata  <kazu@codesourcery.com>
+
+       PR target/27266
+       * config/i386/i386.c (ix86_expand_branch): Jump to simple if
+       ix86_compare_emitted is non-NULL.
+
 2006-05-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27451
index d1f087c..b004415 100644 (file)
@@ -10175,6 +10175,12 @@ ix86_expand_branch (enum rtx_code code, rtx label)
 {
   rtx tmp;
 
+  /* If we have emitted a compare insn, go straight to simple.
+     ix86_expand_compare won't emit anything if ix86_compare_emitted
+     is non NULL.  */
+  if (ix86_compare_emitted)
+    goto simple;
+
   switch (GET_MODE (ix86_compare_op0))
     {
     case QImode:
index 89b9a02..79ec93c 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-22  Kazu Hirata  <kazu@codesourcery.com>
+
+       PR target/27266
+       * gcc.target/i386/pr27266.c: New.
+
 2006-05-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27451
diff --git a/gcc/testsuite/gcc.target/i386/pr27266.c b/gcc/testsuite/gcc.target/i386/pr27266.c
new file mode 100644 (file)
index 0000000..73e7c59
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/27266.
+   The testcase below used to trigger an ICE.  */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-march=pentium" } */
+
+signed long long sll;
+
+void
+foo (void)
+{
+  __sync_fetch_and_add (&sll, 1);
+}