aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2016-04-17 18:04:05 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2016-04-17 16:04:05 +0000
commit69a4e898c8f508f0c56c72c791a38bc432e9fa69 (patch)
treedab34f7a272189308734eab631e4f507410d806b /gcc/cgraph.h
parentb3de2446458bf8c61a8e54d6bd424bafe7ab479e (diff)
downloadgcc-69a4e898c8f508f0c56c72c791a38bc432e9fa69.zip
gcc-69a4e898c8f508f0c56c72c791a38bc432e9fa69.tar.gz
gcc-69a4e898c8f508f0c56c72c791a38bc432e9fa69.tar.bz2
re PR c++/70018 (Possible issue around IPO and C++ comdats discovered as pure/const)
PR ipa/70018 * cgraph.h (cgraph_node::set_const_flag, cgraph_node::set_pure_flag): Update prototype to return bool; update comment. * cgraph.c (cgraph_node::call_for_symbol_thunks_and_aliases): Thunks of interposable symbol are interposable, too. (cgraph_set_const_flag_1): Rename to ... (set_const_flag_1): ... this one; change to self recursive function instead of call_for_symbol_thunks_and_aliases. Handle correctly clearnig the flag in all variants and also virtual thunks of const functions are pure; track if any change was done. (cgraph_node::set_const_flag): Update. (struct set_pure_flag_info): New struct. (cgraph_set_pure_flag_1): Rename to ... (set_pure_flag_1): ... this one; take set_pure_flag_info parameter rather than pointer encoded flags; track if any changes was done; handle correctly clearning flag and setting flag of aliases already declared const. (cgraph_node::set_pure_flag): Update. (cgraph_node::set_nothrow_flag): Handle correctly clearning the flag. From-SVN: r235081
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 5b2b4bc..71e31a4 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1113,13 +1113,24 @@ public:
if any to NOTHROW. */
void set_nothrow_flag (bool nothrow);
- /* Set TREE_READONLY on cgraph_node's decl and on aliases of the node
- if any to READONLY. */
- void set_const_flag (bool readonly, bool looping);
+ /* If SET_CONST is true, mark function, aliases and thunks to be ECF_CONST.
+ If SET_CONST if false, clear the flag.
+
+ When setting the flag be careful about possible interposition and
+ do not set the flag for functions that can be interposet and set pure
+ flag for functions that can bind to other definition.
+
+ Return true if any change was done. */
+
+ bool set_const_flag (bool set_const, bool looping);
/* Set DECL_PURE_P on cgraph_node's decl and on aliases of the node
- if any to PURE. */
- void set_pure_flag (bool pure, bool looping);
+ if any to PURE.
+
+ When setting the flag, be careful about possible interposition.
+ Return true if any change was done. */
+
+ bool set_pure_flag (bool pure, bool looping);
/* Call callback on function and aliases associated to the function.
When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are