aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/volatile_aggregate.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2006-11-16 21:25:16 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-11-16 21:25:16 +0000
commita9e64c639ef604bfc2d734b3973dfc0953875877 (patch)
tree3474f1e6d8e5a0484dd9285fb4f30365e230b1df /gcc/testsuite/gnat.dg/volatile_aggregate.adb
parentc8cf9f0f27b4bc784419f60976390c6e4111ccae (diff)
downloadgcc-a9e64c639ef604bfc2d734b3973dfc0953875877.zip
gcc-a9e64c639ef604bfc2d734b3973dfc0953875877.tar.gz
gcc-a9e64c639ef604bfc2d734b3973dfc0953875877.tar.bz2
re PR middle-end/26306 (ICE on volatile array with non-constant bounds)
PR middle-end/26306 * gimplify.c (gimplify_expr): Only force a load for references to non-BLKmode volatile values. * doc/implement-c.texi (Qualifiers implementation): Document the interpretation of what a volatile access is. * doc/extend.texi (C++ Extensions): Rework same documentation. From-SVN: r118900
Diffstat (limited to 'gcc/testsuite/gnat.dg/volatile_aggregate.adb')
-rw-r--r--gcc/testsuite/gnat.dg/volatile_aggregate.adb33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/volatile_aggregate.adb b/gcc/testsuite/gnat.dg/volatile_aggregate.adb
new file mode 100644
index 0000000..e30e28b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/volatile_aggregate.adb
@@ -0,0 +1,33 @@
+-- { dg-do compile }
+
+with System;
+
+procedure Volatile_Aggregate is
+
+ function GetArrayUpperBound return Integer is
+ begin
+ return 2;
+ end GetArrayUpperBound;
+
+ some_value : Integer := GetArrayUpperBound;
+
+ type Gp_Element_Type is record
+ Element : Integer;
+ end record;
+
+ type some_type is array (1 .. some_value) of Gp_Element_Type;
+
+ type Aligned_Some_Type is record
+ Value : aliased some_type;
+ end record;
+
+ for Aligned_Some_Type'Alignment use 8;
+
+ an_aligned_type : aligned_Some_Type;
+ my_address : system.address;
+
+ pragma Volatile (an_aligned_type);
+
+begin
+ my_address := an_aligned_type.value(1)'address;
+end;