[Bug tree-optimization/63551] [4.9/5 Regression] wrong code (segfaults) at -Os on x86_64-linux-gnu

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 21 15:11:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63551

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #3)
> indeed, somewhere we need to view convert the aggregate value... Predicates
> works on conditions on arguments, so I suppose this ought to happen at
> ipa-prop side. Martin?

I disagree, ipa-prop jump functions describe what values callers pass
to callees, it is the conditions of the predicates that need do
describe what then happens to these values, including any conversions.

Anyway, I am bootstrapping the following fix:

Index: src/gcc/ipa-inline-analysis.c
===================================================================
--- src.orig/gcc/ipa-inline-analysis.c
+++ src/gcc/ipa-inline-analysis.c
@@ -880,6 +880,7 @@ evaluate_conditions_for_known_args (stru
     }
       if (c->code == IS_NOT_CONSTANT || c->code == CHANGED)
     continue;
+      val = fold_convert (TREE_TYPE (c->val), val);
       res = fold_binary_to_constant (c->code, boolean_type_node, val, c->val);
       if (res && integer_zerop (res))
     continue;



More information about the Gcc-bugs mailing list