]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/18231 (Nested inline function not inlined)
authorAndrew Pinski <pinskia@physics.uc.edu>
Wed, 3 Nov 2004 19:55:30 +0000 (19:55 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Wed, 3 Nov 2004 19:55:30 +0000 (11:55 -0800)
2004-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/18231
        * tree.c (staticp) <case FUNCTION_DECL>: Nested functions are static
        also.

From-SVN: r90033

gcc/ChangeLog
gcc/tree.c

index e8208f5cc6f2751965e684a9af19197ee14f54c3..5511a4bf95cd67bbccaed88f3421214dcb4cb946 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 1af25cbf1a2ce12be1b607edf18b4a87bb6c3066..3e40c2e7ad04eec14aad34e3d817427f04817c4f 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))