decl.c (gnat_to_gnu_entity): Always build a variable for E_Variable with a pragma...
authorTristan Gingold <gingold@adacore.com>
Sat, 25 Jan 2014 10:42:04 +0000 (10:42 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 25 Jan 2014 10:42:04 +0000 (10:42 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity): Always build a variable
for E_Variable with a pragma Linker_Section.

From-SVN: r207072

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index dceaa99..3c6bf0d 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-25  Tristan Gingold  <gingold@adacore.com>
+
+       * gcc-interface/decl.c (gnat_to_gnu_entity): Always build a variable
+       for E_Variable with a pragma Linker_Section.
+
 2014-01-25  Robert Dewar  <dewar@adacore.com>
 
        * gcc-interface/decl.c (gnat_to_gnu_param): Make sure an Out parameter
index 25e2e78..4180e59 100644 (file)
@@ -575,9 +575,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
       /* Simple variables, loop variables, Out parameters and exceptions.  */
     object:
       {
+       /* Always create a variable for volatile objects and variables seen
+          constant but with a Linker_Section pragma.  */
        bool const_flag
          = ((kind == E_Constant || kind == E_Variable)
             && Is_True_Constant (gnat_entity)
+            && !(kind == E_Variable
+                 && Present (Linker_Section_Pragma (gnat_entity)))
             && !Treat_As_Volatile (gnat_entity)
             && (((Nkind (Declaration_Node (gnat_entity))
                   == N_Object_Declaration)