From ba9ce455bb060016e01dfd1aecf97cbe51623ee9 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 22 Dec 2004 18:43:44 +0000 Subject: [PATCH] * tree-sra.c (type_can_be_decomposed_p): Reject variable sized types. From-SVN: r92494 --- gcc/ChangeLog | 4 ++++ gcc/tree-sra.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85699822a08..9d04f8bdf3b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2004-12-22 Richard Kenner + + * tree-sra.c (type_can_be_decomposed_p): Reject variable sized types. + 2004-12-22 Mark Mitchell * Makefile.in (install-common): Remove special-case code for when diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 04733e32677..1c1739b18b2 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -184,7 +184,8 @@ type_can_be_decomposed_p (tree type) return false; /* The type must have a definite nonzero size. */ - if (TYPE_SIZE (type) == NULL || integer_zerop (TYPE_SIZE (type))) + if (TYPE_SIZE (type) == NULL || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST + || integer_zerop (TYPE_SIZE (type))) goto fail; /* The type must be a non-union aggregate. */