aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-02-04 13:30:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-02-04 13:30:00 +0000
commit1a1640dbb3257532e6d3603c78a5f379f7682dc3 (patch)
treeb1938020726622d9ccc2baa489b6201c3da96fbb /gcc/gimplify.c
parent0fcedd9c98d1f9f880b59b979b77f4db4d9eb391 (diff)
downloadgcc-1a1640dbb3257532e6d3603c78a5f379f7682dc3.zip
gcc-1a1640dbb3257532e6d3603c78a5f379f7682dc3.tar.gz
gcc-1a1640dbb3257532e6d3603c78a5f379f7682dc3.tar.bz2
re PR middle-end/35043 (ICE in tree-data-ref because signed_type_for_types returns NULL)
2008-02-04 Richard Guenther <rguenther@suse.de> PR middle-end/35043 * gimplify.c (gimplify_init_ctor_eval): Convert array indices to TYPE_DOMAINs base type instead of using bitsizetype here. * gcc.c-torture/compile/pr35043.c: New testcase. From-SVN: r132091
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index fe70847..04ed39c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3096,6 +3096,10 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
if (array_elt_type)
{
+ /* Do not use bitsizetype for ARRAY_REF indices. */
+ if (TYPE_DOMAIN (TREE_TYPE (object)))
+ purpose = fold_convert (TREE_TYPE (TYPE_DOMAIN (TREE_TYPE (object))),
+ purpose);
cref = build4 (ARRAY_REF, array_elt_type, unshare_expr (object),
purpose, NULL_TREE, NULL_TREE);
}