gcc/ChangeLog.gimple-classes: * ipa-icf-gimple.c (func_checker::compare_bb): Add checked casts. (func_checker::compare_gimple_assign): Strengthen params from gimple to const gassign *. * ipa-icf-gimple.h (func_checker::compare_gimple_assign): Likewise. --- gcc/ChangeLog.gimple-classes | 8 ++++++++ gcc/ipa-icf-gimple.c | 7 ++++--- gcc/ipa-icf-gimple.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 07f4d6e..5f5d7c4 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,13 @@ 2014-11-05 David Malcolm <dmalc...@redhat.com> + * ipa-icf-gimple.c (func_checker::compare_bb): Add checked casts. + (func_checker::compare_gimple_assign): Strengthen params from + gimple to const gassign *. + * ipa-icf-gimple.h (func_checker::compare_gimple_assign): + Likewise. + +2014-11-05 David Malcolm <dmalc...@redhat.com> + * ipa-prop.c (stmt_may_be_vtbl_ptr_store): Replace is_gimple_assign with dyn_cast, introducing local gassign * "assign_stmt" and using it in place of "stmt" for typesafety. diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index c86e8c3..42ccdda 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -591,7 +591,8 @@ func_checker::compare_bb (sem_bb *bb1, sem_bb *bb2) return return_different_stmts (s1, s2, "GIMPLE_CALL"); break; case GIMPLE_ASSIGN: - if (!compare_gimple_assign (s1, s2)) + if (!compare_gimple_assign (as_a <gassign *> (s1), + as_a <gassign *> (s2))) return return_different_stmts (s1, s2, "GIMPLE_ASSIGN"); break; case GIMPLE_COND: @@ -682,11 +683,11 @@ func_checker::compare_gimple_call (gimple s1, gimple s2) } -/* Verifies for given GIMPLEs S1 and S2 that +/* Verifies for given GASSIGNs S1 and S2 that assignment statements are semantically equivalent. */ bool -func_checker::compare_gimple_assign (gimple s1, gimple s2) +func_checker::compare_gimple_assign (const gassign *s1, const gassign *s2) { tree arg1, arg2; tree_code code1, code2; diff --git a/gcc/ipa-icf-gimple.h b/gcc/ipa-icf-gimple.h index 559df66..b54a14d 100644 --- a/gcc/ipa-icf-gimple.h +++ b/gcc/ipa-icf-gimple.h @@ -163,7 +163,7 @@ public: /* Verifies for given GIMPLEs S1 and S2 that assignment statements are semantically equivalent. */ - bool compare_gimple_assign (gimple s1, gimple s2); + bool compare_gimple_assign (const gassign *s1, const gassign *s2); /* Verifies for given GIMPLEs S1 and S2 that condition statements are semantically equivalent. */ -- 1.7.11.7