From: Eric Botcazou Date: Wed, 1 Sep 2010 12:20:15 +0000 (+0000) Subject: gimplify.c (gimplify_init_constructor): Do not create a temporary for a volatile... X-Git-Tag: releases/gcc-4.3.6~361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0d8868904183a570e31cab468acce17c17cbf92;p=thirdparty%2Fgcc.git 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: r163730 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa4a13ec8454..77ccff35dbd6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-09-01 Eric Botcazou + + * gimplify.c (gimplify_init_constructor): Do not create a temporary for + a volatile LHS if the constructor has only one element. + 2010-08-14 John David Anglin Revert: diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 897c185c1437..a02fa5bdd7bc 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3314,11 +3314,12 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, } } - /* If the target is volatile and we have non-zero elements - initialize the target from a temporary. */ + /* If the target is volatile, we have non-zero elements and more than + 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 + && VEC_length (constructor_elt, elts) > 1) { tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type), NULL); TREE_OPERAND (*expr_p, 0) = temp;