Commit 558af7ca by Eric Botcazou

gimplify.c (gimplify_init_constructor): Do not create a temporary for a volatile LHS if...

	* gimplify.c (gimplify_init_constructor): Do not create a temporary for
	a volatile LHS if the constructor has only one element.

From-SVN: r163727
parent 6e0833db
2010-09-01 Eric Botcazou <ebotcazou@adacore.com>
* gimplify.c (gimplify_init_constructor): Do not create a temporary for
a volatile LHS if the constructor has only one element.
2010-09-01 Mikael Pettersson <mikpe@it.uu.se> 2010-09-01 Mikael Pettersson <mikpe@it.uu.se>
PR bootstrap/45321 PR bootstrap/45321
......
...@@ -3824,11 +3824,12 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ...@@ -3824,11 +3824,12 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
} }
} }
/* If the target is volatile and we have non-zero elements /* If the target is volatile, we have non-zero elements and more than
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
&& VEC_length (constructor_elt, elts) > 1)
{ {
tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type), NULL); tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type), NULL);
TREE_OPERAND (*expr_p, 0) = temp; TREE_OPERAND (*expr_p, 0) = temp;
......
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