Commit 776e4fe2 by Martin Jambor Committed by Martin Jambor

Const parameters are always unmodified

2016-05-18  Martin Jambor  <mjambor@suse.cz>

	PR ipa/69708
	* ipa-prop.c (parm_preserved_before_stmt_p): Return true for loads
	from TREE_READONLY parameters.

From-SVN: r236417
parent 91bb9f80
2016-05-18 Martin Jambor <mjambor@suse.cz>
PR ipa/69708
* ipa-prop.c (parm_preserved_before_stmt_p): Return true for loads
from TREE_READONLY parameters.
2016-05-18 Martin Jambor <mjambor@suse.cz>
PR ipa/69708
* cgraph.h (cgraph_indirect_call_info): New field
guaranteed_unmodified.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment