+2018-07-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/86492
+ * gimple-ssa-store-merging.c
+ (imm_store_chain_info::coalesce_immediate_stores): Call
+ check_no_overlap even for the merge_overlapping case. Formatting fix.
+
2018-07-12 Richard Biener <rguenther@suse.de>
PR middle-end/86479
{
/* Only allow overlapping stores of constants. */
if (info->rhs_code == INTEGER_CST
- && merged_store->stores[0]->rhs_code == INTEGER_CST)
+ && merged_store->stores[0]->rhs_code == INTEGER_CST
+ && check_no_overlap (m_store_info, i, INTEGER_CST,
+ MAX (merged_store->last_order, info->order),
+ MAX (merged_store->start
+ + merged_store->width,
+ info->bitpos + info->bitsize)))
{
merged_store->merge_overlapping (info);
goto done;
info->ops_swapped_p = true;
}
if (check_no_overlap (m_store_info, i, info->rhs_code,
- MAX (merged_store->last_order,
- info->order),
- MAX (merged_store->start
- + merged_store->width,
+ MAX (merged_store->last_order, info->order),
+ MAX (merged_store->start + merged_store->width,
info->bitpos + info->bitsize)))
{
/* Turn MEM_REF into BIT_INSERT_EXPR for bit-field stores. */
+2018-07-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/86492
+ * gcc.c-torture/execute/pr86492.c: New test.
+
2018-07-12 Richard Biener <rguenther@suse.de>
PR c/86453
--- /dev/null
+/* PR tree-optimization/86492 */
+
+union U
+{
+ unsigned int r;
+ struct S
+ {
+ unsigned int a:12;
+ unsigned int b:4;
+ unsigned int c:16;
+ } f;
+};
+
+__attribute__((noipa)) unsigned int
+foo (unsigned int x)
+{
+ union U u;
+ u.r = 0;
+ u.f.c = x;
+ u.f.b = 0xe;
+ return u.r;
+}
+
+int
+main ()
+{
+ union U u;
+ if (__CHAR_BIT__ * __SIZEOF_INT__ != 32 || sizeof (u.r) != sizeof (u.f))
+ return 0;
+ u.r = foo (0x72);
+ if (u.f.a != 0 || u.f.b != 0xe || u.f.c != 0x72)
+ __builtin_abort ();
+ return 0;
+}