summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 19:55:30 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 19:55:30 +0000
commitdedb9173728eacdcef07f0ae1a220295e1ea34fb (patch)
tree72ffe654f75f3c4c1d92b5e65f99d4e8e71bb917
parent688d26a7dce6410bdfd1bf348e21cb0cf72d33f8 (diff)
downloadppe42-gcc-dedb9173728eacdcef07f0ae1a220295e1ea34fb.tar.gz
ppe42-gcc-dedb9173728eacdcef07f0ae1a220295e1ea34fb.zip
2004-11-03 Andrew Pinski <pinskia@physics.uc.edu>
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e8208f5cc6f..5511a4bf95c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/tree.c b/gcc/tree.c
index 1af25cbf1a2..3e40c2e7ad0 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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))
OpenPOWER on IntegriCloud