aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-02-04 21:18:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-02-04 21:18:32 +0000
commit22199fd25dc76dd3c05d935b07761501911dad37 (patch)
tree1c4ad7aecc9a52bcd5edd2acbe583dacca7ff081 /gcc/expr.c
parent70c7fe74f4fb27161188ed61c23925fc566584c6 (diff)
downloadgcc-22199fd25dc76dd3c05d935b07761501911dad37.zip
gcc-22199fd25dc76dd3c05d935b07761501911dad37.tar.gz
gcc-22199fd25dc76dd3c05d935b07761501911dad37.tar.bz2
re PR middle-end/33631 (auto structure not initialized correctly)
2008-02-04 Richard Guenther <rguenther@suse.de> PR middle-end/33631 * expr.c (count_type_elements): Give for unions instead of guessing. * gcc.c-torture/execute/pr33631.c: New testcase. From-SVN: r132096
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 53cb3eb..ade0396 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4975,14 +4975,7 @@ count_type_elements (const_tree type, bool allow_flexarr)
case UNION_TYPE:
case QUAL_UNION_TYPE:
- {
- /* Ho hum. How in the world do we guess here? Clearly it isn't
- right to count the fields. Guess based on the number of words. */
- HOST_WIDE_INT n = int_size_in_bytes (type);
- if (n < 0)
- return -1;
- return n / UNITS_PER_WORD;
- }
+ return -1;
case COMPLEX_TYPE:
return 2;