aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-03-28 11:48:04 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2009-03-28 10:48:04 +0000
commit4a371c8d8f4d2f1aa40d8a976d3d0b157bdb8552 (patch)
tree794e1ba9ea7bc97ee55a7176950e8b447b3fafb6 /gcc
parent6cdb0ee3658b05acfd6e3ffa51047dc4558b14cb (diff)
downloadgcc-4a371c8d8f4d2f1aa40d8a976d3d0b157bdb8552.zip
gcc-4a371c8d8f4d2f1aa40d8a976d3d0b157bdb8552.tar.gz
gcc-4a371c8d8f4d2f1aa40d8a976d3d0b157bdb8552.tar.bz2
cgraph.c (cgraph_function_body_availability): Functions declared inline are always safe to assume that it is not going to be...
* cgraph.c (cgraph_function_body_availability): Functions declared inline are always safe to assume that it is not going to be replaced. From-SVN: r145174
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cgraph.c17
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d9c59b8..ce250d5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-28 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_function_body_availability): Functions declared
+ inline are always safe to assume that it is not going to be replaced.
+
2009-03-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38513
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index b1eea0b..38de8e4 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1429,6 +1429,11 @@ cgraph_function_body_availability (struct cgraph_node *node)
avail = AVAIL_LOCAL;
else if (!node->local.externally_visible)
avail = AVAIL_AVAILABLE;
+ /* Inline functions are safe to be analyzed even if their sybol can
+ be overwritten at runtime. It is not meaningful to enfore any sane
+ behaviour on replacing inline function by different body. */
+ else if (DECL_DECLARED_INLINE_P (node->decl))
+ avail = AVAIL_AVAILABLE;
/* If the function can be overwritten, return OVERWRITABLE. Take
care at least of two notable extensions - the COMDAT functions
@@ -1438,15 +1443,9 @@ cgraph_function_body_availability (struct cgraph_node *node)
??? Does the C++ one definition rule allow us to always return
AVAIL_AVAILABLE here? That would be good reason to preserve this
- hook Similarly deal with extern inline functions - this is again
- necessary to get C++ shared functions having keyed templates
- right and in the C extension documentation we probably should
- document the requirement of both versions of function (extern
- inline and offline) having same side effect characteristics as
- good optimization is what this optimization is about. */
-
- else if (!(*targetm.binds_local_p) (node->decl)
- && !DECL_COMDAT (node->decl) && !DECL_EXTERNAL (node->decl))
+ bit. */
+
+ else if (DECL_REPLACEABLE_P (node->decl) && !DECL_EXTERNAL (node->decl))
avail = AVAIL_OVERWRITABLE;
else avail = AVAIL_AVAILABLE;