]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 dceaa9995db72a514879f0c930252378afef6f1e..3c6bf0dddb67c7c1f3936ad3bb0718a87173d4b9 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 25e2e781cee0156259380df1ab6c95d3a9493bc3..4180e59f6d875c17000dfe2d9b374b6fe2e0f2b0 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)