re PR tree-optimization/52686 (SLP crashes with WIDEN_LSHIFT_EXPR)
authorUlrich Weigand <ulrich.weigand@linaro.org>
Mon, 26 Mar 2012 13:13:07 +0000 (13:13 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Mon, 26 Mar 2012 13:13:07 +0000 (13:13 +0000)
gcc/
PR tree-optimization/52686
* tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle
WIDEN_LSHIFT_EXPR.

gcc/testsuite/
PR tree-optimization/52686
* gcc.target/arm/pr52686.c: New test.

From-SVN: r185795

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr52686.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c

index daa9b83c6ed870cfc037b9b2cb86b3c418977fd8..04c4ec44891ceee7fb74e1cd904095fd9a7beaee 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-26  Ulrich Weigand  <ulrich.weigand@linaro.org>
+
+       PR tree-optimization/52686
+       * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle
+       WIDEN_LSHIFT_EXPR.
+
 2012-03-26  Tristan Gingold  <gingold@adacore.com>
 
        * config/alpha/vms.h (LINK_SPEC): Simplify.
index d7418c821dee88c876530c798139cf9f4199e60c..88c3ee2a9305c5434d5183ee250f4af23ac49ac5 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-26  Ulrich Weigand  <ulrich.weigand@linaro.org>
+
+       PR tree-optimization/52686
+       * gcc.target/arm/pr52686.c: New test.
+
 2012-03-26  Georg-Johann Lay  <avr@gjlay.de>
 
        * gcc.target/avr/torture/avr-torture.exp (AVR_TORTURE_OPTIONS):
diff --git a/gcc/testsuite/gcc.target/arm/pr52686.c b/gcc/testsuite/gcc.target/arm/pr52686.c
new file mode 100644 (file)
index 0000000..66cbc57
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR target/52375 */
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-march=armv7-a -mfloat-abi=softfp -mfpu=neon -O -ftree-vectorize" } */
+
+unsigned int output[4];
+
+void test (unsigned short *p)
+{
+  unsigned int x = *p;
+  if (x)
+    {
+      output[0] = x << 1;
+      output[1] = x << 1;
+      output[2] = x << 1;
+      output[3] = x << 1;
+    }
+}
+
index d6bfe6c60733f044b98ebe7edd1b6ee40d69f973..d9d1abfd480583b19d7eec25cb6fb1ab0ac60f72 100644 (file)
@@ -111,6 +111,7 @@ vect_get_smallest_scalar_type (gimple stmt, HOST_WIDE_INT *lhs_size_unit,
   if (is_gimple_assign (stmt)
       && (gimple_assign_cast_p (stmt)
           || gimple_assign_rhs_code (stmt) == WIDEN_MULT_EXPR
+          || gimple_assign_rhs_code (stmt) == WIDEN_LSHIFT_EXPR
           || gimple_assign_rhs_code (stmt) == FLOAT_EXPR))
     {
       tree rhs_type = TREE_TYPE (gimple_assign_rhs1 (stmt));