PR tree-optimization/71872
* tree-data-ref.c (get_references_in_stmt): Ignore references
with is_gimple_constant get_base_address.
* gcc.c-torture/compile/pr71872.c: New test.
From-SVN: r238351
+2016-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71872
+ * tree-data-ref.c (get_references_in_stmt): Ignore references
+ with is_gimple_constant get_base_address.
+
2016-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
* config/arm/arm.h (TARGET_HAVE_LDACQ): Enable for ARMv8-M Mainline.
+2016-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71872
+ * gcc.c-torture/compile/pr71872.c: New test.
+
2016-07-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
* gcc.target/arm/atomic-comp-swap-release-acquire.c: Rename into ...
--- /dev/null
+/* PR tree-optimization/71872 */
+
+struct __attribute__((may_alias)) S { int a; };
+
+void
+foo (int *x, struct S *y)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ {
+ int a = 0;
+ if (*x)
+ *(struct S *) y = *(struct S *) &a;
+ }
+}
if (DECL_P (op1)
|| (REFERENCE_CLASS_P (op1)
&& (base = get_base_address (op1))
- && TREE_CODE (base) != SSA_NAME))
+ && TREE_CODE (base) != SSA_NAME
+ && !is_gimple_min_invariant (base)))
{
ref.ref = op1;
ref.is_read = true;