diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-02-08 09:40:46 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-02-08 09:40:46 +0000 |
commit | ffe9a0a76e4212d8ec2b41d756ae82ef84d13d40 (patch) | |
tree | e1c0dd395600a81eb425b24b3dd6744e4c20916f /gcc/ada/gcc-interface/utils.c | |
parent | 43f4a281a321cf24391870c340e2a52e8acb6b7f (diff) | |
download | gcc-ffe9a0a76e4212d8ec2b41d756ae82ef84d13d40.zip gcc-ffe9a0a76e4212d8ec2b41d756ae82ef84d13d40.tar.gz gcc-ffe9a0a76e4212d8ec2b41d756ae82ef84d13d40.tar.bz2 |
utils.c (create_var_decl): Set again DECL_COMMON and DECL_IGNORED_P last.
* gcc-interface/utils.c (create_var_decl): Set again DECL_COMMON and
DECL_IGNORED_P last.
From-SVN: r233210
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 0ce571a..a62d9c2 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2484,6 +2484,24 @@ create_var_decl (tree name, tree asm_name, tree type, tree init, DECL_ARTIFICIAL (var_decl) = artificial_p; DECL_EXTERNAL (var_decl) = extern_flag; + TREE_CONSTANT (var_decl) = constant_p; + TREE_READONLY (var_decl) = const_flag; + + /* The object is public if it is external or if it is declared public + and has static storage duration. */ + TREE_PUBLIC (var_decl) = extern_flag || (public_flag && static_storage); + + /* We need to allocate static storage for an object with static storage + duration if it isn't external. */ + TREE_STATIC (var_decl) = !extern_flag && static_storage; + + TREE_SIDE_EFFECTS (var_decl) + = TREE_THIS_VOLATILE (var_decl) + = TYPE_VOLATILE (type) | volatile_flag; + + if (TREE_SIDE_EFFECTS (var_decl)) + TREE_ADDRESSABLE (var_decl) = 1; + /* Ada doesn't feature Fortran-like COMMON variables so we shouldn't try to fiddle with DECL_COMMON. However, on platforms that don't support global BSS sections, uninitialized global variables would @@ -2508,24 +2526,6 @@ create_var_decl (tree name, tree asm_name, tree type, tree init, != null_pointer_node)) DECL_IGNORED_P (var_decl) = 1; - TREE_CONSTANT (var_decl) = constant_p; - TREE_READONLY (var_decl) = const_flag; - - /* The object is public if it is external or if it is declared public - and has static storage duration. */ - TREE_PUBLIC (var_decl) = extern_flag || (public_flag && static_storage); - - /* We need to allocate static storage for an object with static storage - duration if it isn't external. */ - TREE_STATIC (var_decl) = !extern_flag && static_storage; - - TREE_SIDE_EFFECTS (var_decl) - = TREE_THIS_VOLATILE (var_decl) - = TYPE_VOLATILE (type) | volatile_flag; - - if (TREE_SIDE_EFFECTS (var_decl)) - TREE_ADDRESSABLE (var_decl) = 1; - /* ??? Some attributes cannot be applied to CONST_DECLs. */ if (TREE_CODE (var_decl) == VAR_DECL) process_attributes (&var_decl, &attr_list, true, gnat_node); |