diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-06 11:39:07 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-06 11:39:07 +0200 |
commit | 2f3914287d4c1c75394d4f101ad5bd4d9d4b66e8 (patch) | |
tree | 305f8eac06e4d9b00a2a7347b8b47303405eb9b2 /gcc/tree-vect-stmts.c | |
parent | d20eac1b41b9a86128a80f374e029d9638d14cba (diff) | |
download | gcc-2f3914287d4c1c75394d4f101ad5bd4d9d4b66e8.zip gcc-2f3914287d4c1c75394d4f101ad5bd4d9d4b66e8.tar.gz gcc-2f3914287d4c1c75394d4f101ad5bd4d9d4b66e8.tar.bz2 |
re PR tree-optimization/82434 (-fstore-merging does not work reliably.)
PR tree-optimization/82434
* fold-const.h (can_native_encode_type_p,
can_native_encode_string_p): Remove.
* fold-const.c (native_encode_int): Formatting fixes. If ptr is NULL,
don't encode anything, just return what would be otherwise returned.
(native_encode_fixed, native_encode_complex, native_encode_vector):
Likewise.
(native_encode_string): Likewise. Inline by hand
can_native_encode_string_p.
(can_native_encode_type_p): Remove.
(can_native_encode_string_p): Remove.
* tree-vect-stmts.c (vectorizable_store): Instead of testing just
STRING_CSTs using can_native_encode_string_p, test all
CONSTANT_CLASS_P values using native_encode_expr with NULL ptr.
* gimple-ssa-store-merging.c (encode_tree_to_bitpos): Remove last
argument from native_encode_expr.
(rhs_valid_for_store_merging_p): Use native_encode_expr with NULL ptr.
(pass_store_merging::execute): Don't unnecessarily look for 3 stmts,
but just 2.
* gcc.dg/store_merging_9.c: New test.
From-SVN: r253483
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 29b7333..f986b75 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5728,10 +5728,9 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, op = gimple_assign_rhs1 (stmt); - /* In the case this is a store from a STRING_CST make sure + /* In the case this is a store from a constant make sure native_encode_expr can handle it. */ - if (TREE_CODE (op) == STRING_CST - && ! can_native_encode_string_p (op)) + if (CONSTANT_CLASS_P (op) && native_encode_expr (op, NULL, 64) == 0) return false; if (!vect_is_simple_use (op, vinfo, &def_stmt, &dt, &rhs_vectype)) |