This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/27753] ICE in make_ssa_name on autovect-branch



------- Comment #1 from gcc at pdoerfler dot com  2006-05-24 11:41 -------
This is probably related to or a duplicate of PR26362.
Anyways, this is now a C++ testcase instead of fortran.

The patch by rth posted in that PR makes the ICE go away. 
Here is an updated version that applies cleanly:

Index: targhooks.c
===================================================================
--- targhooks.c (revision 114040)
+++ targhooks.c (working copy)
@@ -455,7 +455,8 @@
   tree type;
   enum machine_mode mode;
   block_stmt_iterator bsi;
-  tree th, tl, result, x;
+  tree t1, t2, x;
+  int i, n;

   /* If the first argument is a type, just check if support
      is available. Return a non NULL value if supported, NULL_TREE otherwise.
@@ -479,31 +480,36 @@
     return NULL;

   bsi = bsi_for_stmt (stmt);
-
-  th = make_rename_temp (type, NULL);
-  x = build2 (VEC_INTERLEAVE_HIGH_EXPR, type, vec1, vec2);
-  x = build2 (MODIFY_EXPR, type, th, x);
-  th = make_ssa_name (th, x);
-  TREE_OPERAND (x, 0) = th;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+  n = exact_log2 (GET_MODE_NUNITS (mode)) - 1;
+  for (i = 0; i < n; ++i)
+    {
+      t1 = create_tmp_var (type, NULL);
+      add_referenced_tmp_var (t1);
+      x = build2 (VEC_INTERLEAVE_HIGH_EXPR, type, vec1, vec2);
+      x = build2 (MODIFY_EXPR, type, t1, x);
+      t1 = make_ssa_name (t1, x);
+      TREE_OPERAND (x, 0) = t1;
+      bsi_insert_before (&bsi, x, BSI_SAME_STMT);

-  tl = make_rename_temp (type, NULL);
-  x = build2 (VEC_INTERLEAVE_LOW_EXPR, type, vec1, vec2);
-  x = build2 (MODIFY_EXPR, type, tl, x);
-  tl = make_ssa_name (tl, x);
-  TREE_OPERAND (x, 0) = tl;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+      t2 = create_tmp_var (type, NULL);
+      add_referenced_tmp_var (t2);
+      x = build2 (VEC_INTERLEAVE_LOW_EXPR, type, vec1, vec2);
+      x = build2 (MODIFY_EXPR, type, t2, x);
+      t2 = make_ssa_name (t2, x);
+      TREE_OPERAND (x, 0) = t2;
+      bsi_insert_before (&bsi, x, BSI_SAME_STMT);

-  result = make_rename_temp (type, NULL);
-  /* ??? Endianness issues?  */
+      if (BYTES_BIG_ENDIAN)
+                vec1 = t1, vec2 = t2;
+      else
+                vec1 = t2, vec2 = t1;
+    }
+
   x = build2 (odd_p ? VEC_INTERLEAVE_HIGH_EXPR : VEC_INTERLEAVE_LOW_EXPR,
-             type, th, tl);
-  x = build2 (MODIFY_EXPR, type, result, x);
-  result = make_ssa_name (result, x);
-  TREE_OPERAND (x, 0) = result;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+                      type, vec1, vec2);
+  x = build2 (MODIFY_EXPR, type, dest, x);

-  return result;
+  return x;
 }

 tree


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27753


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]