]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/35737 (ICE with __builtin_setjmp and complex variable)
authorRichard Henderson <rth@redhat.com>
Wed, 1 Oct 2008 14:28:04 +0000 (07:28 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 1 Oct 2008 14:28:04 +0000 (07:28 -0700)
        PR tree-opt/35737
        * tree-complex.c (set_component_ssa_name): Don't optimize
        is_gimple_min_invariant values with ssa_names in abnormal phis.

From-SVN: r140812

gcc/ChangeLog
gcc/testsuite/gcc.c-torture/compile/complex-6.c [new file with mode: 0644]
gcc/tree-complex.c

index b6f16013f8493bb765f4a51ad741225b356ad969..8dd8eb5c57e439e89c25e4e670f07d18ded035d3 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-01  Richard Henderson  <rth@redhat.com>
+
+       PR tree-opt/35737
+       * tree-complex.c (set_component_ssa_name): Don't optimize
+       is_gimple_min_invariant values with ssa_names in abnormal phis.
+
 2008-09-30  Paolo Bonzini  <bonzini@gnu.org>
 
        PR tree-optimization/37662
diff --git a/gcc/testsuite/gcc.c-torture/compile/complex-6.c b/gcc/testsuite/gcc.c-torture/compile/complex-6.c
new file mode 100644 (file)
index 0000000..eb89040
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR tree-opt/35737 */
+
+long buf[10];
+
+int foo()
+{
+  __complex__ int i = 0;
+
+  if (__builtin_setjmp(buf))
+  {
+    i = 1;
+    bar();
+  }
+
+  return i == 0;
+}
+
index bbf4c494218e466927cbc1a03b1e026d2033d7a0..939bd6f1a63c4b49335ee4f2eeefd3bee7477470 100644 (file)
@@ -537,7 +537,8 @@ set_component_ssa_name (tree ssa_name, bool imag_p, tree value)
   /* If we've nothing assigned, and the value we're given is already stable,
      then install that as the value for this SSA_NAME.  This preemptively
      copy-propagates the value, which avoids unnecessary memory allocation.  */
-  else if (is_gimple_min_invariant (value))
+  else if (is_gimple_min_invariant (value)
+          && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name))
     {
       VEC_replace (tree, complex_ssa_name_components, ssa_name_index, value);
       return NULL;