This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/14694] [tree-ssa] SEGV in tree-nested.c compiling glibc
- From: "dnovillo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2004 15:26:59 -0000
- Subject: [Bug middle-end/14694] [tree-ssa] SEGV in tree-nested.c compiling glibc
- References: <20040323152512.14694.dnovillo@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-03-23 15:26 -------
Proposed patch.
Index: tree-nested.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-nested.c,v
retrieving revision 1.1.2.4
diff -d -u -p -r1.1.2.4 tree-nested.c
--- tree-nested.c 18 Mar 2004 22:43:56 -0000 1.1.2.4
+++ tree-nested.c 23 Mar 2004 15:26:16 -0000
@@ -55,7 +55,7 @@
The implementation here is much more direct. Everything that can be
referenced by an inner function is a member of an explicitly created
- structure herein called the "nonlocal frame struct". The incomming
+ structure herein called the "nonlocal frame struct". The incoming
static chain for a nested function is a pointer to this struct in
the parent. In this way, we settle on known offsets from a known
base, and so are decoupled from the logic that places objects in the
@@ -717,7 +717,10 @@ convert_nonlocal_reference (tree *tp, in
{
case VAR_DECL:
/* Non-automatic variables are never processed. */
- if (TREE_STATIC (t) || DECL_EXTERNAL (t))
+ if (TREE_STATIC (t)
+ || DECL_EXTERNAL (t)
+ || DECL_NONLOCAL (t)
+ || decl_function_context (t) == NULL_TREE)
break;
/* FALLTHRU */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14694