diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-01-15 10:31:28 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-01-15 10:31:28 +0100 |
commit | ff7848297eb1516dca6f023766866c8e6771d57f (patch) | |
tree | fd8e90b5557638e064987b6da3dd91ca61186bc0 /gcc | |
parent | cd61690f63612fc5e50945e446a44b9ee34c088c (diff) | |
download | gcc-ff7848297eb1516dca6f023766866c8e6771d57f.zip gcc-ff7848297eb1516dca6f023766866c8e6771d57f.tar.gz gcc-ff7848297eb1516dca6f023766866c8e6771d57f.tar.bz2 |
re PR tree-optimization/55955 (ICE in optab_for_tree_code, at optabs.c:402)
PR tree-optimization/55955
* tree-vect-loop.c (vectorizable_reduction): Give up early on
*SHIFT_EXPR and *ROTATE_EXPR codes.
* gcc.c-torture/compile/pr55955.c: New test.
From-SVN: r195190
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr55955.c | 12 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 11 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b4f1d4..ea0e4fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2013-01-15 Jakub Jelinek <jakub@redhat.com> + PR tree-optimization/55955 + * tree-vect-loop.c (vectorizable_reduction): Give up early on + *SHIFT_EXPR and *ROTATE_EXPR codes. + PR tree-optimization/48766 * opts.c (common_handle_option): For -fwrapv disable -ftrapv, for -ftrapv disable -fwrapv. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 26a479b..a80f16b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-15 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/55955 + * gcc.c-torture/compile/pr55955.c: New test. + 2013-01-15 Dodji Seketeli <dodji@redhat.com> PR c++/55663 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr55955.c b/gcc/testsuite/gcc.c-torture/compile/pr55955.c new file mode 100644 index 0000000..2656ffb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr55955.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/55955 */ + +int b; + +void +foo (int x) +{ + int a; + for (a = x; a < 2; a++) + for (b = 0; b < 2; b++) + *(unsigned short *) 0x100000UL %= 46; +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 3a470e3..d4f6bc7 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4776,6 +4776,17 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, { /* 4. Supportable by target? */ + if (code == LSHIFT_EXPR || code == RSHIFT_EXPR + || code == LROTATE_EXPR || code == RROTATE_EXPR) + { + /* Shifts and rotates are only supported by vectorizable_shifts, + not vectorizable_reduction. */ + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "unsupported shift or rotation."); + return false; + } + /* 4.1. check support for the operation in the loop */ optab = optab_for_tree_code (code, vectype_in, optab_default); if (!optab) |