re PR tree-optimization/35431 (ICE with complex integer, invalid gimple)
authorAndrew Pinski <pinskia@gmail.com>
Mon, 31 Mar 2008 09:45:53 +0000 (02:45 -0700)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 31 Mar 2008 09:45:53 +0000 (02:45 -0700)
2008-03-31  Andrew Pinski  <pinskia@gmail.com>

        PR tree-opt/35431
        * tree-ssa-phiopt.c (conditional_replacement): Return early for
        complex types.

2008-03-31  Andrew Pinski  <pinskia@gmail.com>

        PR tree-opt/35431
        * gcc.c-torture/compile/pr35431.c: New testcase.

From-SVN: r133749

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr35431.c [new file with mode: 0644]
gcc/tree-ssa-phiopt.c

index 6568174321709deff13677b5fecfbaaba0911fb1..f7be8f1f2ae79e0253c4322beeff1af864a40afd 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-31  Andrew Pinski  <pinskia@gmail.com>
+
+       PR tree-opt/35431
+       * tree-ssa-phiopt.c (conditional_replacement): Return early for
+       complex types.
+
 2008-03-31  Jan Beulich  <jbeulich@novell.com>
 
        * config/ia64/constraints.md: Add 'j' constraint.
index f81763a5129481834e31aa937ccae6a0b183712b..06b43d93dae4e98dcbd715227ab039d4aae52e45 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-31  Andrew Pinski  <pinskia@gmail.com>
+
+       PR tree-opt/35431
+       * gcc.c-torture/compile/pr35431.c: New testcase.
+
 2008-03-30  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * g++.dg/other/error27.C: Use -fno-finite-math-only on sh*
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35431.c b/gcc/testsuite/gcc.c-torture/compile/pr35431.c
new file mode 100644 (file)
index 0000000..ffe9d06
--- /dev/null
@@ -0,0 +1,15 @@
+void bar();
+
+void foo(int i)
+{
+  __complex__ int k = 0;
+
+  if (i)
+    k = 1;
+
+  for (i = 0; i < 1; ++i)
+    ;
+
+  if (k)
+    bar();
+}
index bfe4fed4ba6a138b40b97f6b50135d4e6a2cf1f1..2a8c87827f73b3395d821769b0a4f8d4de21e529 100644 (file)
@@ -463,6 +463,11 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
   tree new_var = NULL;
   tree new_var1;
 
+  /* FIXME: Gimplification of complex type is too hard for now.  */
+  if (TREE_CODE (TREE_TYPE (arg0)) == COMPLEX_TYPE
+      || TREE_CODE (TREE_TYPE (arg1)) == COMPLEX_TYPE)
+    return false;
+
   /* The PHI arguments have the constants 0 and 1, then convert
      it to the conditional.  */
   if ((integer_zerop (arg0) && integer_onep (arg1))