]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/32216 (ICE: verify_stmts failed (invalid reference prefix...
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 6 Jun 2007 12:12:32 +0000 (14:12 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 6 Jun 2007 12:12:32 +0000 (14:12 +0200)
PR tree-optimization/32216
* tree-vectorizer.c (supportable_widening_operation): Determine
signedness of FIX_TRUNC_EXPR from output operand.
(supportable_narrowing_operation): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Determine
signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
from input operand.

testsuite/ChangeLog:

PR tree-optimization/32216
* gcc.dg/vect/pr32216.c: New test.

From-SVN: r125482

gcc/ChangeLog
gcc/optabs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr32216.c [new file with mode: 0644]
gcc/tree-vect-generic.c
gcc/tree-vectorizer.c

index addf5a2894b4e15479a05bbc4f6fd717c167518c..5fa424d81d5f33f524d4c609c47482ef3c27a173 100644 (file)
@@ -1,8 +1,18 @@
+2007-06-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/32216
+       * tree-vectorizer.c (supportable_widening_operation): Determine
+       signedness of FIX_TRUNC_EXPR from output operand.
+       (supportable_narrowing_operation): Ditto.
+       * tree-vect-generic.c (expand_vector_operations_1): Determine
+       signedness of VEC_UNPACK_FLOAT_HI_EXPR and VEC_UNPACK_FLOAT_LO_EXPR
+       from input operand.
+
 2007-06-06  Thomas Neumann  <tneumann@users.sourceforge.net>
 
        * config/i386/i386.c (enum pta_flags): Move out of struct scope...
-       (struct pta): ...from here. Change flags to unsigned to avoid excessive
-       casting (as it is used as a bit mask).
+       (struct pta): ...from here. Change flags to unsigned to avoid
+       excessive casting (as it is used as a bit mask).
        (override_options): Add casts according to the coding convenventions.
        (x86_64_elf_unique_section): Likewise.
        (examine_argument): Avoid using C++ keywords as variable names.
index d659132c1e9c1f91272d664cebd1d962ead039f0..47114fcaa5cc377a730b99b5972698e2984e8771 100644 (file)
@@ -357,6 +357,7 @@ optab_for_tree_code (enum tree_code code, tree type)
       return TYPE_UNSIGNED (type) ? vec_pack_usat_optab : vec_pack_ssat_optab;
 
     case VEC_PACK_FIX_TRUNC_EXPR:
+      /* The signedness is determined from output operand.  */
       return TYPE_UNSIGNED (type) ?
        vec_pack_ufix_trunc_optab : vec_pack_sfix_trunc_optab;
 
index 3990087283b7e02c30c3c0e7f33da7147e4f8c65..766369d57546c3c722fed41d60fd6af4548b717f 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-06  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/32216
+       * gcc.dg/vect/pr32216.c: New test.
+
 2007-06-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR testsuite/18923
diff --git a/gcc/testsuite/gcc.dg/vect/pr32216.c b/gcc/testsuite/gcc.dg/vect/pr32216.c
new file mode 100644 (file)
index 0000000..cf27441
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_floatint_cvt } */
+
+unsigned int wlookup2[203];
+
+SetSoundVariables (int x)
+{
+  for (x = 1; x < 32; x++)
+  {
+    wlookup2[x] = (double) 16 / x;
+  }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index e955c44743cec86c9ae2bb15775e45b4a344b898..8c0bbd556fa76502ebc22dfb14b15b80aafac1f5 100644 (file)
@@ -412,17 +412,22 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
     return;
   
   gcc_assert (code != CONVERT_EXPR);
+
+  /* The signedness is determined from input argument.  */
+  if (code == VEC_UNPACK_FLOAT_HI_EXPR
+      || code == VEC_UNPACK_FLOAT_LO_EXPR)
+    type = TREE_TYPE (TREE_OPERAND (rhs, 0));
+
   op = optab_for_tree_code (code, type);
 
   /* For widening/narrowing vector operations, the relevant type is of the 
-     arguments, not the widened result.  */
+     arguments, not the widened result.  VEC_UNPACK_FLOAT_*_EXPR is
+     calculated in the same way above.  */
   if (code == WIDEN_SUM_EXPR
       || code == VEC_WIDEN_MULT_HI_EXPR
       || code == VEC_WIDEN_MULT_LO_EXPR
       || code == VEC_UNPACK_HI_EXPR
       || code == VEC_UNPACK_LO_EXPR
-      || code == VEC_UNPACK_FLOAT_HI_EXPR
-      || code == VEC_UNPACK_FLOAT_LO_EXPR
       || code == VEC_PACK_TRUNC_EXPR
       || code == VEC_PACK_SAT_EXPR
       || code == VEC_PACK_FIX_TRUNC_EXPR)
index be2d6b3c7f7b83da88c20971e5152f418687b48e..8dba4d03cf944fcf7b886315407db1ca03e51c42 100644 (file)
@@ -1851,10 +1851,17 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
       gcc_unreachable ();
     }
 
-  *code1 = c1;
-  *code2 = c2;
-  optab1 = optab_for_tree_code (c1, vectype);
-  optab2 = optab_for_tree_code (c2, vectype);
+  if (code == FIX_TRUNC_EXPR)
+    {
+      /* The signedness is determined from output operand.  */
+      optab1 = optab_for_tree_code (c1, type);
+      optab2 = optab_for_tree_code (c2, type);
+    }
+  else
+    {
+      optab1 = optab_for_tree_code (c1, vectype);
+      optab2 = optab_for_tree_code (c2, vectype);
+    }
 
   if (!optab1 || !optab2)
     return false;
@@ -1867,6 +1874,8 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
       || insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
     return false;
 
+  *code1 = c1;
+  *code2 = c2;
   return true;
 }
 
@@ -1918,8 +1927,11 @@ supportable_narrowing_operation (enum tree_code code,
       gcc_unreachable ();
     }
 
-  *code1 = c1;
-  optab1 = optab_for_tree_code (c1, vectype);
+  if (code == FIX_TRUNC_EXPR)
+    /* The signedness is determined from output operand.  */
+    optab1 = optab_for_tree_code (c1, type);
+  else
+    optab1 = optab_for_tree_code (c1, vectype);
 
   if (!optab1)
     return false;
@@ -1929,6 +1941,7 @@ supportable_narrowing_operation (enum tree_code code,
       || insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
     return false;
 
+  *code1 = c1;
   return true;
 }