From 61396dfb2acfe956d420b279b2becec1c4f81ba2 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 11 Nov 2021 14:35:10 +0100 Subject: 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 * 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. --- gcc/cgraph.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 0a1f7c8..e42e305 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1167,6 +1167,10 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node if any. */ bool set_malloc_flag (bool malloc_p); + /* SET TREE_THIS_VOLATILE on cgraph_node's decl and on aliases of the node + if any. */ + bool set_noreturn_flag (bool noreturn_p); + /* If SET_CONST is true, mark function, aliases and thunks to be ECF_CONST. If SET_CONST if false, clear the flag. -- cgit v1.1