]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cgraph.c
re PR c++/70018 (Possible issue around IPO and C++ comdats discovered as pure/const)
authorJan Hubicka <jh@suse.cz>
Sat, 16 Apr 2016 18:54:49 +0000 (20:54 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 16 Apr 2016 18:54:49 +0000 (18:54 +0000)
commitcc950f9882d404b66cecae04519bb42a3c13d7f3
tree309f864360341cd70502972284de03b9c4215fe3
parentf13fe18b5b4881a457c2176214349d322b61e187
re PR c++/70018 (Possible issue around IPO and C++ comdats discovered as pure/const)

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.

From-SVN: r235065
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]