aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2010-11-11 13:03:59 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2010-11-11 13:03:59 +0100
commit280fedf0677108f96d3c701815bccc182eff9fb4 (patch)
tree858b06e1bf0775f367e80028c2b76443c1c53791 /gcc/tree.c
parent778216a0c8f4c2050e074a4f0b2e0c067e32140c (diff)
downloadgcc-280fedf0677108f96d3c701815bccc182eff9fb4.zip
gcc-280fedf0677108f96d3c701815bccc182eff9fb4.tar.gz
gcc-280fedf0677108f96d3c701815bccc182eff9fb4.tar.bz2
re PR tree-optimization/46383 (ICE: in get_binfo_at_offset, at tree.c:10947)
2010-11-11 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46383 * ipa-prop.c (compute_complex_assign_jump_func): Ignore negative offsets. (compute_complex_ancestor_jump_func): Likewise. * tree.c (get_binfo_at_offset): Return NULL_TREE if offset is negative. * testsuite/g++.dg/torture/pr46383.C: New test. From-SVN: r166598
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 756ceaa..52df2be 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10947,10 +10947,10 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
tree fld;
int i;
- gcc_checking_assert (offset >= 0);
if (type == expected_type)
return binfo;
- if (TREE_CODE (type) != RECORD_TYPE)
+ if (TREE_CODE (type) != RECORD_TYPE
+ || offset < 0)
return NULL_TREE;
for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))