aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2021-11-11 14:35:10 +0100
committerJan Hubicka <jh@suse.cz>2021-11-11 14:35:10 +0100
commit61396dfb2acfe956d420b279b2becec1c4f81ba2 (patch)
tree57f81e90ccd47b546d3d5f4715511814beae1cc5 /gcc/ipa-pure-const.c
parente106221db2eee30641b856db68858f1131c0fcf5 (diff)
downloadgcc-61396dfb2acfe956d420b279b2becec1c4f81ba2.zip
gcc-61396dfb2acfe956d420b279b2becec1c4f81ba2.tar.gz
gcc-61396dfb2acfe956d420b279b2becec1c4f81ba2.tar.bz2
Fix noreturn discovery.
Fix ipa-pure-const handling of noreturn flags. It is not safe to set it for interposable symbols and we should also set it for aliases (just like we do for other flags). This patch merely copies other flag handling and implements it here. gcc/ChangeLog: 2021-11-11 Jan Hubicka <hubicka@ucw.cz> * cgraph.c (set_noreturn_flag_1): New function. (cgraph_node::set_noreturn_flag): New member function * cgraph.h (cgraph_node::set_noreturn_flags): Declare. * ipa-pure-const.c (pass_local_pure_const::execute): Use it.
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 505ed4f..84a028b 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -2132,11 +2132,10 @@ pass_local_pure_const::execute (function *fun)
current_function_name ());
/* Update declaration and reduce profile to executed once. */
- TREE_THIS_VOLATILE (current_function_decl) = 1;
+ if (cgraph_node::get (current_function_decl)->set_noreturn_flag (true))
+ changed = true;
if (node->frequency > NODE_FREQUENCY_EXECUTED_ONCE)
node->frequency = NODE_FREQUENCY_EXECUTED_ONCE;
-
- changed = true;
}
switch (l->pure_const_state)