From 8750672faeaa9c633e2b2051c01fab6c6ceef81b Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 4 Mar 2011 10:27:10 +0000 Subject: [PATCH] re PR target/47975 (ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx) 2011-03-04 Richard Guenther 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 | 5 +++++ gcc/optabs.c | 8 ++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr47975.c | 9 +++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr47975.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3086fe01e39..a968fe7449e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-03-04 Richard Guenther + + PR middle-end/47975 + * optabs.c (optab_for_tree_code): Do not use VECTOR_MODE_P. + 2011-03-04 Richard Henderson * explow.c (emit_stack_save): Remove 'after' parameter. diff --git a/gcc/optabs.c b/gcc/optabs.c index 26735dd2ae1..6be8db03cce 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 69b7569c615..c1054228575 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-04 Richard Guenther + + PR middle-end/47975 + * gcc.dg/torture/pr47975.c: New testcase. + 2011-03-03 Paolo Carlini 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 index 00000000000..2919452a024 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47975.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +int __attribute__ ((vector_size (32))) x; + +void +foo (void) +{ + x <<= x; +} -- 2.34.1