diff options
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index dddef52d6f4..0cbd4db4bf2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2009-09-24 Jakub Jelinek <jakub@redhat.com> + + * gcc-interface/utils.c (gnat_pushdecl): Don't set + DECL_NO_STATIC_CHAIN, set DECL_STATIC_CHAIN for + nested functions. + 2009-09-21 Joel Sherrill <joel.sherrill@oarcorp.com> * s-osinte-rtems.ad[bs]: Get_Page_Size cannot return 0. diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 31f24ce0340..1559cf14490 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -439,9 +439,12 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) { DECL_CONTEXT (decl) = current_function_decl; - /* Functions imported in another function are not really nested. */ - if (TREE_CODE (decl) == FUNCTION_DECL && TREE_PUBLIC (decl)) - DECL_NO_STATIC_CHAIN (decl) = 1; + /* Functions imported in another function are not really nested. + For really nested functions mark them initially as needing + a static chain for uses of that flag before unnesting; + lower_nested_functions will then recompute it. */ + if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl)) + DECL_STATIC_CHAIN (decl) = 1; } TREE_NO_WARNING (decl) = (gnat_node == Empty || Warnings_Off (gnat_node)); |