summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 21:35:25 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 21:35:25 +0000
commit454a13077a315a3e394ae4b56875f47ef8b7a305 (patch)
treeb045b940e8c675ad52a8a9376cfb9fe0fcc7abc0 /gcc/tree-ssa-structalias.c
parent0b1c894b43a94f1796bedb679d91fa44a2245294 (diff)
downloadgcc-454a13077a315a3e394ae4b56875f47ef8b7a305.tar.gz
2008-01-08 Richard Guenther <rguenther@suse.de>
PR middle-end/31863 * tree-ssa-structalias.c (push_fields_onto_fieldstack): Bail out early if the result will be unused. * g++.dg/torture/pr31863.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131405 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 5e197c47fee..70a9d3212c6 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4062,7 +4062,13 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
{
tree field;
int count = 0;
- int first_element = VEC_length (fieldoff_s, *fieldstack);
+ unsigned int first_element = VEC_length (fieldoff_s, *fieldstack);
+
+ /* If the vector of fields is growing too big, bail out early.
+ Callers check for VEC_length <= MAX_FIELDS_FOR_FIELD_SENSITIVE, make
+ sure this fails. */
+ if (first_element > MAX_FIELDS_FOR_FIELD_SENSITIVE)
+ return 0;
if (TREE_CODE (type) == COMPLEX_TYPE)
{