+2020-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/93945
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): For memset with non-zero
+ second operand, require ref->size to be a multiple of BITS_PER_UNIT.
+
2020-02-26 Carl Love <cel@us.ibm.com>
PR target/91276
+2020-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/93945
+ * gcc.c-torture/execute/pr93945.c: New test.
+
2020-02-26 Marek Polacek <polacek@redhat.com>
Jakub Jelinek <jakub@redhat.com>
--- /dev/null
+/* PR tree-optimization/93945 */
+
+union U { char a[8]; struct S { unsigned int b : 8, c : 13, d : 11; } e; } u;
+
+__attribute__((noipa)) int
+foo (void)
+{
+ __builtin_memset (&u.a, 0xf4, sizeof (u.a));
+ return u.e.c;
+}
+
+__attribute__((noipa)) int
+bar (void)
+{
+ asm volatile ("" : : "g" (&u) : "memory");
+ return u.e.c;
+}
+
+__attribute__((noipa)) int
+baz (void)
+{
+ __builtin_memset (&u.a, 0xf4, sizeof (u.a));
+ return u.e.d;
+}
+
+__attribute__((noipa)) int
+qux (void)
+{
+ asm volatile ("" : : "g" (&u) : "memory");
+ return u.e.d;
+}
+
+int
+main ()
+{
+ int a = foo ();
+ int b = bar ();
+ if (a != b)
+ __builtin_abort ();
+ a = baz ();
+ b = qux ();
+ if (a != b)
+ __builtin_abort ();
+ return 0;
+}
|| (INTEGRAL_TYPE_P (vr->type) && known_eq (ref->size, 8)))
&& CHAR_BIT == 8 && BITS_PER_UNIT == 8
&& offset.is_constant (&offseti)
- && offseti % BITS_PER_UNIT == 0))
+ && offseti % BITS_PER_UNIT == 0
+ && multiple_p (ref->size, BITS_PER_UNIT)))
&& poly_int_tree_p (gimple_call_arg (def_stmt, 2))
&& (TREE_CODE (gimple_call_arg (def_stmt, 0)) == ADDR_EXPR
|| TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME))