aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-11-23 17:10:19 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-11-23 17:10:19 +0100
commit87501227a9444c3ab7a052eb7fd29ddbb60ef6f8 (patch)
treec1fda98ff764b578213ee9776461662fd25d9ddb /gcc/cp
parenta7194bfea995c4bfc8f01ce18e36ef8bda7ebe16 (diff)
downloadgcc-87501227a9444c3ab7a052eb7fd29ddbb60ef6f8.zip
gcc-87501227a9444c3ab7a052eb7fd29ddbb60ef6f8.tar.gz
gcc-87501227a9444c3ab7a052eb7fd29ddbb60ef6f8.tar.bz2
re PR middle-end/42095 (g++.dg/lto/20081118-1 cp_lto_20081118-1_0.o-cp_lto_20081118-1_1.o link)
PR middle-end/42095 * tree.c: Include cgraph.h. (cp_fix_function_decl_p): Don't return true for same_body aliases. * Make-lang.in (cp/tree.o): Depend on $(CGRAPH_H). From-SVN: r154449
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/tree.c12
3 files changed, 19 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3f28a94..b40ddb6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/42095
+ * tree.c: Include cgraph.h.
+ (cp_fix_function_decl_p): Don't return true for same_body aliases.
+ * Make-lang.in (cp/tree.o): Depend on $(CGRAPH_H).
+
2009-11-23 Dodji Seketeli <dodji@redhat.com>
PR c++/14777
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f5c652e..6e10296 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -281,7 +281,7 @@ cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) toplev.h \
cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \
insn-config.h $(INTEGRATE_H) $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \
- $(TARGET_H) debug.h $(TREE_FLOW_H)
+ $(TARGET_H) debug.h $(TREE_FLOW_H) $(CGRAPH_H)
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \
$(TARGET_H) $(C_PRAGMA_H) gt-cp-rtti.h
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index d431b31..17fc495 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "convert.h"
#include "tree-flow.h"
+#include "cgraph.h"
static tree bot_manip (tree *, int *, void *);
static tree bot_replace (tree *, int *, void *);
@@ -3125,7 +3126,16 @@ cp_fix_function_decl_p (tree decl)
if (!gimple_has_body_p (decl)
&& !DECL_THUNK_P (decl)
&& !DECL_EXTERNAL (decl))
- return true;
+ {
+ struct cgraph_node *node = cgraph_get_node (decl);
+
+ /* Don't fix same_body aliases. Although they don't have their own
+ CFG, they share it with what they alias to. */
+ if (!node
+ || node->decl == decl
+ || !node->same_body)
+ return true;
+ }
return false;
}