Commit 22868cbf by Olivier Hainque Committed by Olivier Hainque

decl.c (gnat_to_gnu_entity): Even when they are never assigned...

        * gcc-interface/decl.c (gnat_to_gnu_entity): Even when they
        are never assigned, volatile entities are not constant for code
        generation purposes.

        * gnat.dg/volatile3.adb: New test.

From-SVN: r140545
parent 5e038cad
2008-09-22 Olivier Hainque <hainque@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Even when they
are never assigned, volatile entities are not constant for code
generation purposes.
2008-09-21 Laurent Guerby <laurent@guerby.net>
PR ada/5911
......@@ -548,6 +548,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
bool const_flag
= ((kind == E_Constant || kind == E_Variable)
&& Is_True_Constant (gnat_entity)
&& !Treat_As_Volatile (gnat_entity)
&& (((Nkind (Declaration_Node (gnat_entity))
== N_Object_Declaration)
&& Present (Expression (Declaration_Node (gnat_entity))))
......
2008-09-22 Olivier Hainque <hainque@adacore.com>
* gnat.dg/volatile3.adb: New test.
2008-09-22 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/37482
......
-- { dg-do compile }
-- { dg-options "-O2" }
procedure volatile3 is
v1 : Integer := 0;
v2 : Integer := 0;
pragma Volatile (v1);
pragma Volatile (v2);
begin
if v1 /= v2 then
raise Program_Error;
end if;
end;
-- { dg-final { scan-assembler "__gnat_rcheck" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment