From 0b6455f7241b8935aecc4b89fff31db08faab0d8 Mon Sep 17 00:00:00 2001 From: jamborm Date: Wed, 3 Dec 2014 14:05:51 +0000 Subject: [PATCH] 2014-12-03 Martin Jambor PR ipa/64153 * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Check type sizes before view_converting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218316 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-inline-analysis.c | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e9d9c6c99a1..610606494cd9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-03 Martin Jambor + + PR ipa/64153 + * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Check + type sizes before view_converting. + 2014-12-03 H.J. Lu PR rtl-optimization/64151 diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 71b56fda62e8..a2500d0c06ba 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -880,12 +880,19 @@ evaluate_conditions_for_known_args (struct cgraph_node *node, } if (c->code == IS_NOT_CONSTANT || c->code == CHANGED) continue; - val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (c->val), val); - res = val - ? fold_binary_to_constant (c->code, boolean_type_node, val, c->val) - : NULL; - if (res && integer_zerop (res)) - continue; + + if (operand_equal_p (TYPE_SIZE (TREE_TYPE (c->val)), + TYPE_SIZE (TREE_TYPE (val)), 0)) + { + val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (c->val), val); + + res = val + ? fold_binary_to_constant (c->code, boolean_type_node, val, c->val) + : NULL; + + if (res && integer_zerop (res)) + continue; + } clause |= 1 << (i + predicate_first_dynamic_condition); } return clause; -- 2.47.3