aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-store-merging.c
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2016-11-02 09:25:22 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2016-11-02 09:25:22 +0000
commit63e523d6f0853765adc332c7a68a8e6b16971d6b (patch)
treeaedc40b214eadb2e102ee0d7a959c8b882146450 /gcc/gimple-ssa-store-merging.c
parent04ddfe064b58a9ce69a332942d51722dfb13db66 (diff)
downloadgcc-63e523d6f0853765adc332c7a68a8e6b16971d6b.zip
gcc-63e523d6f0853765adc332c7a68a8e6b16971d6b.tar.gz
gcc-63e523d6f0853765adc332c7a68a8e6b16971d6b.tar.bz2
PR tree-optimization/78162: Reject negative offsets in store merging early
PR tree-optimization/78162 * gimple-ssa-store-merging.c (execute): Mark stores with bitpos < 0 as invalid. * gcc.c-torture/compile/pr78162.c: New test. From-SVN: r241778
Diffstat (limited to 'gcc/gimple-ssa-store-merging.c')
-rw-r--r--gcc/gimple-ssa-store-merging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index 97af141..feba907 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -1361,7 +1361,7 @@ pass_store_merging::execute (function *fun)
&unsignedp, &reversep, &volatilep);
/* As a future enhancement we could handle stores with the same
base and offset. */
- bool invalid = offset || reversep
+ bool invalid = offset || reversep || bitpos < 0
|| ((bitsize > MAX_BITSIZE_MODE_ANY_INT)
&& (TREE_CODE (rhs) != INTEGER_CST))
|| !rhs_valid_for_store_merging_p (rhs)