aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2006-05-17 13:11:09 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-05-17 13:11:09 +0000
commit2e3b8fe7b5405a94d86bfa323c0e80e83c58d784 (patch)
treefc8e1b142697f52cdee3f2e49bb0e10fb379c754 /gcc
parent9cb8f1bac57900cba3d92cb4bd2e23e1ffc19653 (diff)
downloadgcc-2e3b8fe7b5405a94d86bfa323c0e80e83c58d784.zip
gcc-2e3b8fe7b5405a94d86bfa323c0e80e83c58d784.tar.gz
gcc-2e3b8fe7b5405a94d86bfa323c0e80e83c58d784.tar.bz2
tree.c (variably_modified_type_p): Return true if the element type is variably modified without recursing.
* tree.c (variably_modified_type_p) <ARRAY_TYPE>: Return true if the element type is variably modified without recursing. From-SVN: r113858
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4ecc27a..1f1f7fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.c (variably_modified_type_p) <ARRAY_TYPE>: Return true
+ if the element type is variably modified without recursing.
+
2006-05-17 Sebastian Pop <pop@cri.ensmp.fr>
PR middle-end/27332
diff --git a/gcc/tree.c b/gcc/tree.c
index 207df84..049ec09 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5635,13 +5635,12 @@ variably_modified_type_p (tree type, tree fn)
When a representation is chosen, this function should be modified
to test for that case as well. */
RETURN_TRUE_IF_VAR (TYPE_SIZE (type));
- RETURN_TRUE_IF_VAR (TYPE_SIZE_UNIT(type));
+ RETURN_TRUE_IF_VAR (TYPE_SIZE_UNIT (type));
switch (TREE_CODE (type))
{
case POINTER_TYPE:
case REFERENCE_TYPE:
- case ARRAY_TYPE:
case VECTOR_TYPE:
if (variably_modified_type_p (TREE_TYPE (type), fn))
return true;
@@ -5690,6 +5689,13 @@ variably_modified_type_p (tree type, tree fn)
}
break;
+ case ARRAY_TYPE:
+ /* Do not call ourselves to avoid infinite recursion. This is
+ variably modified if the element type is. */
+ RETURN_TRUE_IF_VAR (TYPE_SIZE (TREE_TYPE (type)));
+ RETURN_TRUE_IF_VAR (TYPE_SIZE_UNIT (TREE_TYPE (type)));
+ break;
+
default:
break;
}