This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/14694] [tree-ssa] SEGV in tree-nested.c compiling glibc


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-03-23 20:12 -------

The patch was incomplete.  We also need similar changes in convert_local_reference.

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 20:11:55 -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,9 @@ 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_function_context (t) == NULL_TREE)
        break;
       /* FALLTHRU */

@@ -807,7 +809,9 @@ convert_local_reference (tree *tp, int *
     {
     case VAR_DECL:
       /* Non-automatic variables are never processed.  */
-      if (TREE_STATIC (t) || DECL_EXTERNAL (t))
+      if (TREE_STATIC (t)
+         || DECL_EXTERNAL (t)
+         || decl_function_context (t) == NULL_TREE)
        break;
       /* FALLTHRU */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14694


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]