From 63e523d6f0853765adc332c7a68a8e6b16971d6b Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Wed, 2 Nov 2016 09:25:22 +0000 Subject: 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 --- gcc/gimple-ssa-store-merging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/gimple-ssa-store-merging.c') 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) -- cgit v1.1