2019-07-11 Richard Biener <rguenther@suse.de>
PR middle-end/91131
* gimplify.c (gimplify_compound_literal_expr): Force a temporary
when the object is volatile and we have not cleared it even though
there are no nonzero elements.
* gcc.target/i386/pr91131.c: New testcase.
From-SVN: r273376
+2019-07-11 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/91131
+ * gimplify.c (gimplify_compound_literal_expr): Force a temporary
+ when the object is volatile and we have not cleared it even though
+ there are no nonzero elements.
+
2019-07-10 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/predicates.md (cint34_operand): Update
one field to assign, initialize the target from a temporary. */
if (TREE_THIS_VOLATILE (object)
&& !TREE_ADDRESSABLE (type)
- && num_nonzero_elements > 0
+ && (num_nonzero_elements > 0 || !cleared)
&& vec_safe_length (elts) > 1)
{
tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type));
+2019-07-11 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/91131
+ * gcc.target/i386/pr91131.c: New testcase.
+
2019-07-10 Martin Sebor <msebor@redhat.com>
PR testsuite/91132
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct Reg_T {
+ unsigned int a : 3;
+ unsigned int b : 1;
+ unsigned int c : 4;
+};
+
+volatile struct Reg_T Reg_A;
+
+int
+main ()
+{
+ Reg_A = (struct Reg_T){ .a = 0, .b = 0, .c = 0 };
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "mov\[^\r\n\]*Reg_A" 1 } } */