diff options
author | Olivier Hainque <hainque@adacore.com> | 2008-09-22 10:29:29 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2008-09-22 10:29:29 +0000 |
commit | 22868cbf560231317a5c82348c08d396fa29f471 (patch) | |
tree | 5e64426e997f556d62e9350e72dd76e3c4b421ad /gcc/testsuite | |
parent | 5e038cad0bb468177c7adad1faebf3465ecda0fd (diff) | |
download | gcc-22868cbf560231317a5c82348c08d396fa29f471.zip gcc-22868cbf560231317a5c82348c08d396fa29f471.tar.gz gcc-22868cbf560231317a5c82348c08d396fa29f471.tar.bz2 |
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
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/volatile3.adb | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2af0a0e..e9b7422 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/gcc/testsuite/gnat.dg/volatile3.adb b/gcc/testsuite/gnat.dg/volatile3.adb new file mode 100644 index 0000000..bd0e96a --- /dev/null +++ b/gcc/testsuite/gnat.dg/volatile3.adb @@ -0,0 +1,16 @@ +-- { 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" } } |