diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-11 18:58:05 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-11 18:58:05 +0000 |
commit | 1a614365dff7f06fbbc8665b7937bf0ff08b5096 (patch) | |
tree | 37425a6a59c6e2da923d37b739cbb1c65f2cfbd9 /gcc/cp | |
parent | 9d8bf4aaa54e04d9e4f1c39121f7b89e11c4202b (diff) | |
download | gcc-1a614365dff7f06fbbc8665b7937bf0ff08b5096.tar.gz |
PR target/29487
* tree.h (DECL_REPLACEABLE_P): New macro.
* except.c (set_nothrow_function_flags): Likewise.
PR target/29487
* decl.c (finish_function): Use DECL_REPLACEABLE.
* tree.c (cp_cannot_inline_tree_fn): Likewise.
PR c++/29487
* g++.dg/eh/weak1-C: New test.
* g++.dg/eh/weak1-a.cc: Likewise.
* g++.dg/eh/comdat1.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121819 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/tree.c | 10 |
3 files changed, 10 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9fcd66a732e..f4afe068525 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-02-06 Mark Mitchell <mark@codesourcery.com> + + PR target/29487 + * decl.c (finish_function): Use DECL_REPLACEABLE. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net> * parser.c (cp_parser_primary_expression): Reformat overly long lines. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b6d0e5387f7..2212254a1b0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11225,7 +11225,7 @@ finish_function (int flags) if (!processing_template_decl && !cp_function_chain->can_throw && !flag_non_call_exceptions - && targetm.binds_local_p (fndecl)) + && !DECL_REPLACEABLE_P (fndecl)) TREE_NOTHROW (fndecl) = 1; /* This must come after expand_function_end because cleanups might diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 78545e13a4a..a3d11a334d9 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2209,13 +2209,9 @@ cp_cannot_inline_tree_fn (tree* fnp) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) return 1; - /* Don't auto-inline anything that might not be bound within - this unit of translation. - Exclude comdat functions from this rule. While they can be bound - to the other unit, they all must be the same. This is especially - important so templates can inline. */ - if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn) - && !DECL_COMDAT (fn)) + /* Don't auto-inline functions that might be replaced at link-time + with an alternative definition. */ + if (!DECL_DECLARED_INLINE_P (fn) && DECL_REPLACEABLE_P (fn)) { DECL_UNINLINABLE (fn) = 1; return 1; |