aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-06-14 17:44:58 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-06-14 17:44:58 -0400
commit86270344f372ea02de71326b452e9d9434977b0f (patch)
tree85e924b24c9c2c9b2c94301382f290237e9cbf68 /gcc
parent761a3df02f7b72b609e8ba2a73b28d35092017ce (diff)
downloadgcc-86270344f372ea02de71326b452e9d9434977b0f.zip
gcc-86270344f372ea02de71326b452e9d9434977b0f.tar.gz
gcc-86270344f372ea02de71326b452e9d9434977b0f.tar.bz2
(staticp, case FUNCTION_DECL): A nested function isn't static.
From-SVN: r7466
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 6e15640..1839b31 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1903,8 +1903,13 @@ staticp (arg)
{
switch (TREE_CODE (arg))
{
- case VAR_DECL:
case FUNCTION_DECL:
+ /* Nested functions aren't static. Since taking their address
+ involves a trampoline. */
+ if (decl_function_context (arg) != 0)
+ return 0;
+ /* ... fall through ... */
+ case VAR_DECL:
return TREE_STATIC (arg) || DECL_EXTERNAL (arg);
case CONSTRUCTOR: