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
This commit is contained in:
Martin Jambor 2016-05-18 18:41:19 +02:00 committed by Martin Jambor
parent 91bb9f80e5
commit 776e4fe2ca
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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