⛏️ index : buildtools.git

author Oliver Tappe <zooey@hirschkaefer.de> 2004-10-28 18:36:18.0 +00:00:00
committer Oliver Tappe <zooey@hirschkaefer.de> 2004-10-28 18:36:18.0 +00:00:00
commit
552d1c2e8d1a0ebd36f5aececd99be6847641667 [patch]
tree
d0077f8f74f5a02e7fb2944e6317a7504d9b91e6
parent
cb1ff25317a95cd0d47792e2f32caf475641262b
download
552d1c2e8d1a0ebd36f5aececd99be6847641667.tar.gz

avoid overoptimizing implicitly generated functions of local classes in order to fix linking errors.

git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9620 a95241bf-73f2-0310-859d-f6bbb57e9c96

Diff

 gcc/gcc/toplev.c | 2 ++
 gcc/gcc/cp/lex.c | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/gcc/gcc/toplev.c b/gcc/gcc/toplev.c
index 9f40abb..85cff8e 100644
--- a/gcc/gcc/toplev.c
+++ b/gcc/gcc/toplev.c
@@ -2800,6 +2800,8 @@
	      && DECL_INITIAL (decl) != 0
	      && DECL_SAVED_INSNS (decl) != 0
	      && (flag_keep_inline_functions
	          // [zooey] always output addressable functions:
		  || TREE_ADDRESSABLE (decl)
		  || (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
		  || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
	    {
diff --git a/gcc/gcc/cp/lex.c b/gcc/gcc/cp/lex.c
index 0f5c188..6cd018c 100644
--- a/gcc/gcc/cp/lex.c
+++ b/gcc/gcc/cp/lex.c
@@ -2034,6 +2034,14 @@
  /* Show that this function was generated by the compiler.  */
  SET_DECL_ARTIFICIAL (fn);
  
  /* [zooey] force functions of local classes into such a mode, that they
     will be output even after being inlined. This circumvents a bug that
     causes undefined symbols when linking against files using local classes. */
  if (DECL_CONTEXT (fn) != NULL_TREE && hack_decl_function_context (fn))
    // functions whose address is needed have to be put out even when inlined,
    // so we use this to get the desired effect:
    TREE_ADDRESSABLE(fn) = 1;	

  return fn;
}