diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-18 15:42:05 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-18 15:42:05 +0000 |
commit | e2b35abeb5c6a6e396c0134b837f5f9549b1e295 (patch) | |
tree | b651b6fca641f62fb15a629675a5e9a97f9ad4a0 /gcc/ada | |
parent | 4b0479e96dc0228f2d4a0c19c42298008ea95a7b (diff) | |
download | gcc-e2b35abeb5c6a6e396c0134b837f5f9549b1e295.tar.gz |
PR middle-end/42068
(create_var_decl_1): Do not set COMMON flag for unit local variables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c80c02911dd..aa01613abe4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2010-01-18 Jan Hubicka <jh@suse.cz> + + PR middle-end/42068 + (create_var_decl_1): Do not set COMMON flag for unit local variables. + 2010-01-17 Laurent GUERBY <laurent@guerby.net> * gcc-interface/Makefile.in: Fix typo in arm*-*-linux-gnueabi. diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 38795a0cea6..51756544183 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1387,6 +1387,13 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, that is, not violating a No_Elaboration_Code restriction. */ if (global_bindings_p () && var_init != 0 && ! init_const) Check_Elaboration_Code_Allowed (gnat_node); + DECL_INITIAL (var_decl) = var_init; + TREE_READONLY (var_decl) = const_flag; + DECL_EXTERNAL (var_decl) = extern_flag; + TREE_PUBLIC (var_decl) = public_flag || extern_flag; + TREE_CONSTANT (var_decl) = constant_p; + TREE_THIS_VOLATILE (var_decl) = TREE_SIDE_EFFECTS (var_decl) + = TYPE_VOLATILE (type); /* Ada doesn't feature Fortran-like COMMON variables so we shouldn't try to fiddle with DECL_COMMON. However, on platforms that don't @@ -1394,15 +1401,9 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init, go in DATA instead, thus increasing the size of the executable. */ if (!flag_no_common && TREE_CODE (var_decl) == VAR_DECL + && TREE_PUBLIC (var_decl) && !have_global_bss_p ()) DECL_COMMON (var_decl) = 1; - DECL_INITIAL (var_decl) = var_init; - TREE_READONLY (var_decl) = const_flag; - DECL_EXTERNAL (var_decl) = extern_flag; - TREE_PUBLIC (var_decl) = public_flag || extern_flag; - TREE_CONSTANT (var_decl) = constant_p; - TREE_THIS_VOLATILE (var_decl) = TREE_SIDE_EFFECTS (var_decl) - = TYPE_VOLATILE (type); /* If it's public and not external, always allocate storage for it. At the global binding level we need to allocate static storage for the |