Message ID | 20160512160844.GJ5580@virgil.suse.cz |
---|---|
State | New |
Headers | show |
On 05/12/2016 10:08 AM, Martin Jambor wrote: > 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 <mjambor@suse.cz> > > * ipa-prop.c (parm_preserved_before_stmt_p): Return true for loads > from TREE_READONLY parameters. Seems like a good idea irrespective of the other patches in this series. OK for the trunk. Is this related to 69708, if so you might want to add that marker to the ChangeLog entry. jeff
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