diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-09-07 16:31:40 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-09-07 16:31:40 +0200 |
commit | 128c61eeb9dd76409237dcfae26dbbc0d0db34de (patch) | |
tree | e969f2f11f577d85c9f099b5655d7f7e74744bed /gcc/ipa-cp.c | |
parent | da990dc0e09b05638d0ec80e719c1cbd2615d76e (diff) | |
download | gcc-128c61eeb9dd76409237dcfae26dbbc0d0db34de.zip gcc-128c61eeb9dd76409237dcfae26dbbc0d0db34de.tar.gz gcc-128c61eeb9dd76409237dcfae26dbbc0d0db34de.tar.bz2 |
re PR middle-end/50301 (416.gamess in SPEC CPU 2006 failed to build with LTO)
2011-09-07 Martin Jambor <mjambor@suse.cz>
PR middle-end/50301
* ipa-cp.c (find_more_values_for_callers_subset): Check jump
function index bounds.
(perhaps_add_new_callers): Likewise.
From-SVN: r178640
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index f6e083e..f440b1d 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -2052,8 +2052,12 @@ find_more_values_for_callers_subset (struct cgraph_node *node, struct ipa_jump_func *jump_func; tree t; + if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))) + { + newval = NULL_TREE; + break; + } jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i); - t = ipa_value_from_jfunc (IPA_NODE_REF (cs->caller), jump_func); if (!t || (newval @@ -2123,6 +2127,11 @@ perhaps_add_new_callers (struct cgraph_node *node, struct ipcp_value *val) if (!val) continue; + if (i >= ipa_get_cs_argument_count (args)) + { + insufficient = true; + break; + } jump_func = ipa_get_ith_jump_func (args, i); t = ipa_value_from_jfunc (caller_info, jump_func); if (!t || !values_equal_for_ipcp_p (val, t)) |