re PR target/47975 (ICE: in expand_shift, at expmed.c:2299 when using 256b vectors...
authorRichard Guenther <rguenther@suse.de>
Fri, 4 Mar 2011 10:27:10 +0000 (10:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Mar 2011 10:27:10 +0000 (10:27 +0000)
2011-03-04  Richard Guenther  <rguenther@suse.de>

PR middle-end/47975
* optabs.c (optab_for_tree_code): Do not use VECTOR_MODE_P.

* gcc.dg/torture/pr47975.c: New testcase.

From-SVN: r170672

gcc/ChangeLog
gcc/optabs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr47975.c [new file with mode: 0644]

index 3086fe01e3988f021b902da2eface71de997e916..a968fe7449e1d7b71f742021578f5be070357c77 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-04  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47975
+       * optabs.c (optab_for_tree_code): Do not use VECTOR_MODE_P.
+
 2011-03-04  Richard Henderson  <rth@redhat.com>
 
        * explow.c (emit_stack_save): Remove 'after' parameter.
index 26735dd2ae1a9a472dce4a6d4825edf379cb97d8..6be8db03cce70f48ba2ee17e9cd88757b81f28fc 100644 (file)
@@ -303,7 +303,7 @@ optab_for_tree_code (enum tree_code code, const_tree type,
       return TYPE_UNSIGNED (type) ? udiv_optab : sdiv_optab;
 
     case LSHIFT_EXPR:
-      if (VECTOR_MODE_P (TYPE_MODE (type)))
+      if (TREE_CODE (type) == VECTOR_TYPE)
        {
          if (subtype == optab_vector)
            return TYPE_SATURATING (type) ? NULL : vashl_optab;
@@ -315,7 +315,7 @@ optab_for_tree_code (enum tree_code code, const_tree type,
       return ashl_optab;
 
     case RSHIFT_EXPR:
-      if (VECTOR_MODE_P (TYPE_MODE (type)))
+      if (TREE_CODE (type) == VECTOR_TYPE)
        {
          if (subtype == optab_vector)
            return TYPE_UNSIGNED (type) ? vlshr_optab : vashr_optab;
@@ -325,7 +325,7 @@ optab_for_tree_code (enum tree_code code, const_tree type,
       return TYPE_UNSIGNED (type) ? lshr_optab : ashr_optab;
 
     case LROTATE_EXPR:
-      if (VECTOR_MODE_P (TYPE_MODE (type)))
+      if (TREE_CODE (type) == VECTOR_TYPE)
        {
          if (subtype == optab_vector)
            return vrotl_optab;
@@ -335,7 +335,7 @@ optab_for_tree_code (enum tree_code code, const_tree type,
       return rotl_optab;
 
     case RROTATE_EXPR:
-      if (VECTOR_MODE_P (TYPE_MODE (type)))
+      if (TREE_CODE (type) == VECTOR_TYPE)
        {
          if (subtype == optab_vector)
            return vrotr_optab;
index 69b7569c61542ca4da8634c6c44f901b6ec1a681..c10542285755267b5deacc475aa35ac319e1cb71 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-04  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47975
+       * gcc.dg/torture/pr47975.c: New testcase.
+
 2011-03-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/47974
diff --git a/gcc/testsuite/gcc.dg/torture/pr47975.c b/gcc/testsuite/gcc.dg/torture/pr47975.c
new file mode 100644 (file)
index 0000000..2919452
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+int __attribute__ ((vector_size (32))) x;
+
+void
+foo (void)
+{
+  x <<= x;
+}