summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-27 19:28:51 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-27 19:28:51 +0000
commit5c0c8e545868eb89c38a44ba2449d16734122caa (patch)
tree31d929d6040dc9c05644874e12dc4dfc535548eb
parent1362c85bd8e199337a9858aa99c0ab583a94e572 (diff)
downloadgcc-5c0c8e545868eb89c38a44ba2449d16734122caa.tar.gz
* expr.c (store_constructor): Restore sanity check on
the size of the type before clearing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82335 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6691fabb8ac..9f39261febc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-27 Olivier Hainque <hainque@act-europe.fr>
+
+ * expr.c (store_constructor): Restore sanity check on
+ the size of the type before clearing.
+
2004-05-27 Jan Hubicka <jh@suse.cz>
* cfgbuild.c (control_flow_insn_p): Notice noreturn call
diff --git a/gcc/expr.c b/gcc/expr.c
index dd0725811ed..5aa3efaa23d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4673,8 +4673,9 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
clear the whole structure first. Don't do this if TARGET is a
register whose mode size isn't equal to SIZE since clear_storage
can't handle this case. */
- else if (((list_length (CONSTRUCTOR_ELTS (exp)) != fields_length (type))
- || mostly_zeros_p (exp))
+ else if (size > 0
+ && ((list_length (CONSTRUCTOR_ELTS (exp)) != fields_length (type))
+ || mostly_zeros_p (exp))
&& (GET_CODE (target) != REG
|| ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
== size)))