aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1999-10-20 22:19:06 +0000
committerJim Wilson <wilson@gcc.gnu.org>1999-10-20 15:19:06 -0700
commit417d348c5a9cba8d5d9b407523ea54f52c061b3e (patch)
treec329b1b6f7eb3b47edbbd06db5f5be40e11fea38 /gcc
parent276ab4a49cabf93897caa27ada91672c1f0ffff1 (diff)
downloadgcc-417d348c5a9cba8d5d9b407523ea54f52c061b3e.zip
gcc-417d348c5a9cba8d5d9b407523ea54f52c061b3e.tar.gz
gcc-417d348c5a9cba8d5d9b407523ea54f52c061b3e.tar.bz2
Fix numerous -O3 -g testsuite failures for DWARF2 targets.
* integrate.c (integrate_decl_tree): Set DECL_CONTEXT to 0 if this is a local extern function declaration. From-SVN: r30107
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/integrate.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cdd6b0f..998c467 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 20 15:18:42 1999 Jim Wilson <wilson@cygnus.com>
+
+ * integrate.c (integrate_decl_tree): Set DECL_CONTEXT to 0 if this is
+ a local extern function declaration.
+
Wed Oct 20 13:56:01 1999 Richard Henderson <rth@cygnus.com>
* i386.c (ix86_expand_prologue): Properly wrap USE around
diff --git a/gcc/integrate.c b/gcc/integrate.c
index bd2e662..e312b18 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -1419,10 +1419,23 @@ integrate_decl_tree (let, map)
if (DECL_LANG_SPECIFIC (d))
copy_lang_decl (d);
+ /* ??? We used to call pushdecl here, but that does not work now that
+ we generate entire functions as trees. We only want the pushdecl
+ code that sets DECL_CONTEXT. Each front end sets DECL_CONTEXT
+ slightly differently though, so we may need new callbacks to the
+ front-ends to do this right. For now, we just use the code from the
+ C front end and hope that is sufficient. Alternatively, we could
+ set DECL_CONTEXT (d) here only if DECL_CONTEXT (t) is non-null. */
/* This new declaration is now in the scope of the function into
which we are inlining the function, not the function being
inlined. */
DECL_CONTEXT (d) = current_function_decl;
+ /* A local extern declaration for a function doesn't constitute nesting.
+ A local auto declaration does, since it's a forward decl
+ for a nested function coming later. */
+ if (TREE_CODE (d) == FUNCTION_DECL && DECL_INITIAL (d) == 0
+ && DECL_EXTERNAL (d))
+ DECL_CONTEXT (d) = 0;
/* Add this declaration to the list of variables in the new
block. */