aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2010-09-01 12:15:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-09-01 12:15:08 +0000
commit558af7ca1ccbaa309e390e871c620574a7446e4f (patch)
tree2007e1650009708b5fc84ff70fa3d964c0926435 /gcc
parent6e0833db45350585bc60abfc891181db8142ca61 (diff)
downloadgcc-558af7ca1ccbaa309e390e871c620574a7446e4f.zip
gcc-558af7ca1ccbaa309e390e871c620574a7446e4f.tar.gz
gcc-558af7ca1ccbaa309e390e871c620574a7446e4f.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/gimplify.c7
2 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ca67d7f..fd03ae7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,11 +1,16 @@
+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>
- PR bootstrap/45321
- * tree.c (stdarg_p): Make fntype parameter const.
- * tree.h (stdarg_p): Likewise.
- (function_args_iterator): Remove unused fntype field.
- (function_args_iter_init): Do not initialize fntype
- field. Make fntype parameter const.
+ PR bootstrap/45321
+ * tree.c (stdarg_p): Make fntype parameter const.
+ * tree.h (stdarg_p): Likewise.
+ (function_args_iterator): Remove unused fntype field.
+ (function_args_iter_init): Do not initialize fntype
+ field. Make fntype parameter const.
2010-09-01 Richard Guenther <rguenther@suse.de>
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 52d83f6..b0468c6 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -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
- 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;