OSDN Git Service

PR tree-opt/22116
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 19 Jun 2005 06:32:31 +0000 (06:32 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 19 Jun 2005 06:32:31 +0000 (06:32 +0000)
        * tree-ssa-pre.c (create_expression_by_pieces): Set
        DECL_COMPLEX_GIMPLE_REG_P.
        (insert_into_preds_of_block): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101177 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 767fd7c..293b0a5 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-18  Richard Henderson  <rth@redhat.com>
+
+       PR tree-opt/22116
+       * tree-ssa-pre.c (create_expression_by_pieces): Set
+       DECL_COMPLEX_GIMPLE_REG_P.
+       (insert_into_preds_of_block): Likewise.
+
 2005-06-18  Steven Bosscher  <stevenb@suse.de>
 
        * Makefile.in: Fix tree-cfgcleanup.c dependencies.
diff --git a/gcc/testsuite/gcc.c-torture/compile/complex-3.c b/gcc/testsuite/gcc.c-torture/compile/complex-3.c
new file mode 100644 (file)
index 0000000..f12a8f9
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR 22116 */
+
+void g(_Complex float);
+_Complex float f(int data, _Complex float x, _Complex float y)
+{
+  _Complex float i, t;
+  if (data) 
+  {
+    i = x +  __imag__ y;
+    g(i);
+  }
+  else
+    i = 5;
+  t = x + __imag__ y;
+  g(t);
+  return t * i;
+}
index 6ec3cdc..a46c367 100644 (file)
@@ -1593,6 +1593,8 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts)
      that we will return.  */
   temp = create_tmp_var (TREE_TYPE (expr), "pretmp");
   add_referenced_tmp_var (temp);
+  if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
+    DECL_COMPLEX_GIMPLE_REG_P (temp) = 1;
   newexpr = build (MODIFY_EXPR, TREE_TYPE (expr), temp, newexpr);
   name = make_ssa_name (temp, newexpr);
   TREE_OPERAND (newexpr, 0) = name;
@@ -1699,6 +1701,8 @@ insert_into_preds_of_block (basic_block block, value_set_node_t node,
   /* Now build a phi for the new variable.  */
   temp = create_tmp_var (type, tmpname);
   add_referenced_tmp_var (temp);
+  if (TREE_CODE (type) == COMPLEX_TYPE)
+    DECL_COMPLEX_GIMPLE_REG_P (temp) = 1;
   temp = create_phi_node (temp, block);
   NECESSARY (temp) = 0; 
   VEC_safe_push (tree, heap, inserted_exprs, temp);