diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-12-12 00:49:30 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-12-12 00:49:30 +0100 |
commit | f5c03155aa77bdb065fed3c5a0031db45a850493 (patch) | |
tree | 663f9c03ab5cfa1241566de459ae21079f9630d5 | |
parent | 4f9438698143ae15df338ce085f765c1a5016b36 (diff) | |
download | gcc-f5c03155aa77bdb065fed3c5a0031db45a850493.zip gcc-f5c03155aa77bdb065fed3c5a0031db45a850493.tar.gz gcc-f5c03155aa77bdb065fed3c5a0031db45a850493.tar.bz2 |
re PR target/92723 (ICE in expand_shift_1, at expmed.c:2635)
PR target/92723
* tree-vect-patterns.c (vect_recog_rotate_pattern): If dt is not
vect_internal_def, use oprnd1 as is, without trying to cast it.
Formatting fix.
* gcc.dg/vect/pr92723.c: New test.
From-SVN: r279265
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr92723.c | 9 | ||||
-rw-r--r-- | gcc/tree-vect-patterns.c | 15 |
4 files changed, 24 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88abb6d..4be2b96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-12-11 Jakub Jelinek <jakub@redhat.com> + + PR target/92723 + * tree-vect-patterns.c (vect_recog_rotate_pattern): If dt is not + vect_internal_def, use oprnd1 as is, without trying to cast it. + Formatting fix. + 2019-12-11 Martin Sebor <msebor@redhat.com> * builtins.c (compute_objsize): Add an argument and set it to offset diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4856592..8488ae9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-12-11 Jakub Jelinek <jakub@redhat.com> + + PR target/92723 + * gcc.dg/vect/pr92723.c: New test. + 2019-12-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/92897 diff --git a/gcc/testsuite/gcc.dg/vect/pr92723.c b/gcc/testsuite/gcc.dg/vect/pr92723.c new file mode 100644 index 0000000..0d60883 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr92723.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +void +foo (unsigned long long *x, unsigned long long *y, int z) +{ + int i; + for (i = 0; i < 1024; i++) + x[i] = (y[i] >> z) | (y[i] << (-z & (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1))); +} diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index c9ad9e0..ae41cbe 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -2432,14 +2432,12 @@ vect_recog_rotate_pattern (stmt_vec_info stmt_vinfo, tree *type_out) oprnd0 = def; } - if (dt == vect_external_def - && TREE_CODE (oprnd1) == SSA_NAME) + if (dt == vect_external_def && TREE_CODE (oprnd1) == SSA_NAME) ext_def = vect_get_external_def_edge (vinfo, oprnd1); def = NULL_TREE; scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type); - if (TREE_CODE (oprnd1) == INTEGER_CST - || TYPE_MODE (TREE_TYPE (oprnd1)) == mode) + if (dt != vect_internal_def || TYPE_MODE (TREE_TYPE (oprnd1)) == mode) def = oprnd1; else if (def_stmt && gimple_assign_cast_p (def_stmt)) { @@ -2454,14 +2452,7 @@ vect_recog_rotate_pattern (stmt_vec_info stmt_vinfo, tree *type_out) { def = vect_recog_temp_ssa_var (type, NULL); def_stmt = gimple_build_assign (def, NOP_EXPR, oprnd1); - if (ext_def) - { - basic_block new_bb - = gsi_insert_on_edge_immediate (ext_def, def_stmt); - gcc_assert (!new_bb); - } - else - append_pattern_def_seq (stmt_vinfo, def_stmt); + append_pattern_def_seq (stmt_vinfo, def_stmt); } stype = TREE_TYPE (def); scalar_int_mode smode = SCALAR_INT_TYPE_MODE (stype); |