Commit 63e523d6 by Kyrylo Tkachov Committed by Kyrylo Tkachov

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
parent 04ddfe06
2016-11-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR tree-optimization/78162
* gimple-ssa-store-merging.c (execute): Mark stores with bitpos < 0
as invalid.
2016-11-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_register_saved_on_entry): Add
function comment.
(aarch64_next_callee_save): Likewise.
......@@ -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)
......
2016-11-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR tree-optimization/78162
* gcc.c-torture/compile/pr78162.c: New test.
2016-11-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/78035
......
/* PR tree-optimization/78162.
Handle negative offsets in store merging gracefully. */
int a, b[1][2];
void fn1()
{
for (a = 0; a < 2; a++)
b[-1][a] = 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment