2004-11-03 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Nov 2004 19:55:30 +0000 (19:55 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 3 Nov 2004 19:55:30 +0000 (19:55 +0000)
        PR tree-opt/18231
        * tree.c (staticp) <case FUNCTION_DECL>: Nested functions are static
        also.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90033 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree.c

index e8208f5..5511a4b 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/18231
+       * tree.c (staticp) <case FUNCTION_DECL>: Nested functions are static
+       also.
+
 2004-11-03  Andrew MacLeod  <amacleod@redhat.com>
 
        PR tree-optimization/18270
index 1af25cb..3e40c2e 100644 (file)
@@ -1573,11 +1573,10 @@ staticp (tree arg)
   switch (TREE_CODE (arg))
     {
     case FUNCTION_DECL:
-      /* Nested functions aren't static, since taking their address
-        involves a trampoline.  */
-      return ((decl_function_context (arg) == 0 || DECL_NO_STATIC_CHAIN (arg))
-             && ! DECL_NON_ADDR_CONST_P (arg)
-             ? arg : NULL);
+      /* Nested functions are static, even though taking their address will
+        involve a trampoline as we unnest the nested function and create
+        the trampoline on the tree level.  */
+      return arg;
 
     case VAR_DECL:
       return ((TREE_STATIC (arg) || DECL_EXTERNAL (arg))