+2019-07-05 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91091
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): Overlap of
+ accesses can happen with -fno-strict-aliasing.
+
2019-07-05 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-alias.c (alias_stats): Add
+2019-07-05 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91091
+ * gcc.dg/tree-ssa/pr91091-1.c: New testcase.
+ * gcc.dg/tree-ssa/ssa-fre-61.c: Adjust.
+
2019-07-05 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack23.adb, gnat.dg/pack23_pkg.ads: New testcase.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-strict-aliasing" } */
+
+struct s { int x; } __attribute__((packed));
+struct t { int x; };
+
+void __attribute__((noinline,noipa))
+swap(struct s* p, struct t* q)
+{
+ p->x = q->x;
+ q->x = p->x;
+}
+
+int main()
+{
+ struct t a[2];
+ a[0].x = 0x12345678;
+ a[1].x = 0x98765432;
+ swap ((struct s *)((char *)a + 1), a);
+ if (a[0].x != 0x12345678)
+ __builtin_abort ();
+ return 0;
+}
/* { dg-do link } */
-/* { dg-options "-O -fdump-tree-fre1-details" } */
+/* { dg-options "-O -fstrict-aliasing -fdump-tree-fre1-details" } */
void link_error (void);
activation of a union member via a store makes the
values of untouched bytes unspecified. */
&& (known_eq (ref->size, BITS_PER_UNIT)
- || (get_alias_set (lhs) != 0
+ || (flag_strict_aliasing
+ && get_alias_set (lhs) != 0
&& ao_ref_alias_set (ref) != 0)))
{
tree *saved_last_vuse_ptr = data->last_vuse_ptr;