Hi, this patch simply makes parm_preserved_before_stmt_p consider all const PARM_DECLs constant and does not invoke AA walking on them (really the DECLs themselves, not the memory they might point to).
Bootstrapped and lto-bootstrapped and tested on x86_64-linux. OK for trunk? Thanks, Martin 2016-05-10 Martin Jambor <mjam...@suse.cz> * ipa-prop.c (parm_preserved_before_stmt_p): Return true for loads from TREE_READONLY parameters. --- gcc/ipa-prop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index afbc32b..7d869ed 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -803,6 +803,11 @@ parm_preserved_before_stmt_p (struct ipa_func_body_info *fbi, int index, bool modified = false; ao_ref refd; + tree base = get_base_address (parm_load); + gcc_assert (TREE_CODE (base) == PARM_DECL); + if (TREE_READONLY (base)) + return true; + /* FIXME: FBI can be NULL if we are being called from outside ipa_node_analysis or ipcp_transform_function, which currently happens during inlining analysis. It would be great to extend fbi's lifetime and -- 2.8.2