Commit 3e66e7b0 by Richard Biener Committed by Richard Biener

re PR middle-end/91131 (Bad bitfield coalescing)

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
parent 639000e2
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> 2019-07-10 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/predicates.md (cint34_operand): Update * config/rs6000/predicates.md (cint34_operand): Update
......
...@@ -5005,7 +5005,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ...@@ -5005,7 +5005,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
one field to assign, initialize the target from a temporary. */ one field to assign, initialize the target from a temporary. */
if (TREE_THIS_VOLATILE (object) if (TREE_THIS_VOLATILE (object)
&& !TREE_ADDRESSABLE (type) && !TREE_ADDRESSABLE (type)
&& num_nonzero_elements > 0 && (num_nonzero_elements > 0 || !cleared)
&& vec_safe_length (elts) > 1) && vec_safe_length (elts) > 1)
{ {
tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type)); 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> 2019-07-10 Martin Sebor <msebor@redhat.com>
PR testsuite/91132 PR testsuite/91132
......
/* { 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 } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment