]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/32243 (ICE in vectorizable_type_promotion, at tree-vect-trans...
authorUros Bizjak <ubizjak@gmail.com>
Fri, 8 Jun 2007 09:06:46 +0000 (11:06 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 8 Jun 2007 09:06:46 +0000 (11:06 +0200)
PR tree-optimization/32243
* tree-vect-transform.c (vectorizable_type_promotion): Move check
for ncopies after ratio check between nunits_out and nunits_in.
(vectorizable_type_demotion): Remove single-use variable "scalar_type".

testsuite/ChangeLog:

PR tree-optimization/32243
* gcc.dg/vect/vect.exp: Add support for -O3 tests.  Reset default
flags for -Os tests.
* gcc.dg/vect/03-vect-pr32243.c: New test.

From-SVN: r125567

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect.exp
gcc/tree-vect-transform.c

index 5ebdcd42f0eedb709a544914a2ae22bba6498247..0e9aefd80d4db39beb0bac9842f0ca70c88576a3 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/32243
+       * tree-vect-transform.c (vectorizable_type_promotion): Move check
+       for ncopies after ratio check between nunits_out and nunits_in.
+       (vectorizable_type_demotion): Remove single-use variable "scalar_type".
+
 2007-06-08  Dorit Nuzman  <dorit@il.ibm.com>
 
        PR tree-optimization/32224
index 6102817e854c118b94bd03f43aa5fbf0d8fa3829..55d0ee54dd2978b780e758d8c2f2dee944740044 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/32243
+       * gcc.dg/vect/vect.exp: Add support for -O3 tests.  Reset default
+       flags for -Os tests.
+       * gcc.dg/vect/03-vect-pr32243.c: New test.
+
 2007-06-08  Dorit Nuzman  <dorit@il.ibm.com>
 
        PR tree-optimization/32224
diff --git a/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c b/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c
new file mode 100644 (file)
index 0000000..0116c33
--- /dev/null
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef struct __GLcontextRec GLcontext;
+
+struct gl_renderbuffer
+{
+  struct gl_renderbuffer *Wrapped;
+  void (*PutValues) (GLcontext * ctx, struct gl_renderbuffer * rb,
+                    int count, const int x[], const int y[],
+                    const void *values, const char *mask);
+};
+
+void
+put_mono_values_s8 (GLcontext * ctx, struct gl_renderbuffer *s8rb,
+                   int count, const int x[], const int y[],
+                   const void *value, const char *mask)
+{
+  struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+  int temp[4096], i;
+  const char val = *((char *) value);
+  for (i = 0; i < count; i++)
+    if (!mask || mask[i])
+      temp[i] = (temp[i] & 0xffffff) | val;
+  dsrb->PutValues (ctx, dsrb, count, x, y, temp, mask);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index db2c258daeba6c62bfdd0c907def6ccb1bbc5f8d..6f3303a85e63a0aeef55cd973fe580d66c85d14d 100644 (file)
@@ -175,10 +175,17 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]]  \
        "" $DEFAULT_VECTCFLAGS
 
 # With -Os
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
 lappend DEFAULT_VECTCFLAGS "-Os"
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]]  \
         "" $DEFAULT_VECTCFLAGS
 
+# With -O3
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-O3"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-vect-*.\[cS\]]]  \
+        "" $DEFAULT_VECTCFLAGS
+
 # Clean up.
 set dg-do-what-default ${save-dg-do-what-default}
 
index eff1ed7db7d3dd9e40ce18d4395a095609141b90..e49fba116a89fdc86106a1051f97d64736581a8c 100644 (file)
@@ -2708,7 +2708,6 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
   int j;
   tree expr;
   tree vectype_in;
-  tree scalar_type;
 
   if (!STMT_VINFO_RELEVANT_P (stmt_info))
     return false;
@@ -2741,8 +2740,7 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
   nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
 
   scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
-  scalar_type = TREE_TYPE (scalar_dest);
-  vectype_out = get_vectype_for_scalar_type (scalar_type);
+  vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
   nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
   if (nunits_in != nunits_out / 2) /* FORNOW */
     return false;
@@ -2887,8 +2885,6 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
   op0 = TREE_OPERAND (operation, 0);
   vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op0));
   nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
-  ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
-  gcc_assert (ncopies >= 1);
 
   scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
   vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
@@ -2896,6 +2892,9 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
   if (nunits_out != nunits_in / 2) /* FORNOW */
     return false;
 
+  ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+  gcc_assert (ncopies >= 1);
+
   if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
          && INTEGRAL_TYPE_P (TREE_TYPE (op0)))
         || (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))