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
+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
&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
--- /dev/null
+/* 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;
+}