PR ipa/70018
commit8b4ee73c4aea63e3702a0a52f0e99c16a1e85d4a
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Apr 2016 18:54:49 +0000 (16 18:54 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Apr 2016 18:54:49 +0000 (16 18:54 +0000)
tree309f864360341cd70502972284de03b9c4215fe3
parent2f7867dc7f35fee6b5fd5a8e8c16a7ec4a8ebbed
PR ipa/70018
* cgraph.c (cgraph_set_const_flag_1): Only set as pure if
function does not bind to current def.
* ipa-pure-const.c (worse_state): Add FROM and TO parameters;
handle conservatively calls to functions that does not need to bind
to current def.
(check_call): Update call of worse_state.
(ignore_edge_for_nothrow): Update.
(ignore_edge_for_pure_const): Likewise.
(propagate_pure_const): Update calls to worse_state.
(skip_function_for_local_pure_const): Reformat comments.

* g++.dg/ipa/pure-const-1.C: New testcase.
* g++.dg/ipa/pure-const-2.C: New testcase.
* g++.dg/ipa/pure-const-3.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235065 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/cgraph.c
gcc/ipa-pure-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pure-const-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ipa/pure-const-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ipa/pure-const-3.C [new file with mode: 0644]