diff options
author | Ian Lance Taylor <iant@google.com> | 2012-01-13 22:25:44 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-13 22:25:44 +0000 |
commit | 9ab6f957a224f4c09edfc740f72fc310066fac9c (patch) | |
tree | 991dad8d536375d0b134be2333d09b76fb5002e2 | |
parent | 8554df86e04cfdbe124f5a11a9fb7bcb0bd4ccc2 (diff) | |
download | gcc-9ab6f957a224f4c09edfc740f72fc310066fac9c.zip gcc-9ab6f957a224f4c09edfc740f72fc310066fac9c.tar.gz gcc-9ab6f957a224f4c09edfc740f72fc310066fac9c.tar.bz2 |
ipa-cp.c (ipa_get_indirect_edge_target): Add typecasts when comparing param_index to VEC_length result.
* ipa-cp.c (ipa_get_indirect_edge_target): Add typecasts when
comparing param_index to VEC_length result.
From-SVN: r183166
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a029051..05ad7ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-01-13 Ian Lance Taylor <iant@google.com> + + * ipa-cp.c (ipa_get_indirect_edge_target): Add typecasts when + comparing param_index to VEC_length result. + 2012-01-13 Steven Bosscher <steven@gcc.gnu.org> * c-decl.c: Do not include tree-mudflap.h diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index ae38366..8a4f992 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1112,7 +1112,7 @@ ipa_get_indirect_edge_target (struct cgraph_edge *ie, if (!ie->indirect_info->polymorphic) { - tree t = (VEC_length (tree, known_vals) > param_index + tree t = (VEC_length (tree, known_vals) > (unsigned int) param_index ? VEC_index (tree, known_vals, param_index) : NULL); if (t && TREE_CODE (t) == ADDR_EXPR @@ -1127,7 +1127,8 @@ ipa_get_indirect_edge_target (struct cgraph_edge *ie, otr_type = ie->indirect_info->otr_type; t = VEC_index (tree, known_vals, param_index); - if (!t && known_binfos && VEC_length (tree, known_binfos) > param_index) + if (!t && known_binfos + && VEC_length (tree, known_binfos) > (unsigned int) param_index) t = VEC_index (tree, known_binfos, param_index); if (!t) return NULL_TREE; |