aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-04-23 16:40:55 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-04-23 16:40:55 +0000
commitbbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489 (patch)
treec50f816477650b4e3cbb25b84c72aae959f07b1b /gcc/testsuite
parent3682dc97d6bf818e4c95c734e4d5588a9d9a4cda (diff)
downloadgcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.zip
gcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.tar.gz
gcc-bbaba73f06d6ebd6e5b3ed96e7fd40537e3fa489.tar.bz2
gimplify.c (gimplify_modify_expr_rhs): Do not do a direct assignment from the constructor either if the target is volatile.
* gimplify.c (gimplify_modify_expr_rhs) <VAR_DECL>: Do not do a direct assignment from the constructor either if the target is volatile. ada/ * einfo.ads (Is_True_Constant): Lift restriction on atomic objects. * sinfo.ads (Object Declaration): Likewise. (Assignment Statement): Likewise. * freeze.adb (Expand_Atomic_Aggregate): Remove useless test. Do not force Is_True_Constant to false on the temporary. (Freeze_Entity): Do not force Is_True_Constant to false on names on the RHS of object declarations. * gcc-interface/trans.c (lvalue_required_p) <N_Object_Declaration>: New case. Return 1 if the object is atomic. <N_Assignment_Statement>: Likewise. From-SVN: r146652
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/atomic1.adb17
-rw-r--r--gcc/testsuite/gnat.dg/atomic1_pkg.ads47
3 files changed, 69 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 390123c..47f4a80 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/atomic1.adb: New test.
+ * gnat.dg/atomic1_pkg.ads: New helper.
+
2009-04-23 Steve Ellcey <sje@cup.hp.com>
PR testsuite/39623
diff --git a/gcc/testsuite/gnat.dg/atomic1.adb b/gcc/testsuite/gnat.dg/atomic1.adb
new file mode 100644
index 0000000..1e5207b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/atomic1.adb
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+-- { dg-options "-O0 -fdump-tree-gimple" }
+
+with Atomic1_Pkg; use Atomic1_Pkg;
+
+procedure Atomic1 is
+
+ C_16 : constant R16 := (2, 3, 5, 7);
+ C_32 : constant R32 := (1, 1, 2, 3, 5, 8, 13, 5);
+
+begin
+ V_16 := C_16;
+ V_32 := C_32;
+end;
+
+-- { dg-final { scan-tree-dump-times "v_16" 1 "gimple"} }
+-- { dg-final { scan-tree-dump-times "v_32" 1 "gimple"} }
diff --git a/gcc/testsuite/gnat.dg/atomic1_pkg.ads b/gcc/testsuite/gnat.dg/atomic1_pkg.ads
new file mode 100644
index 0000000..809c3e3
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/atomic1_pkg.ads
@@ -0,0 +1,47 @@
+package Atomic1_Pkg is
+
+ type Four_Bits is mod 2 ** 4;
+
+ type R16 is record
+ F1 : Four_Bits;
+ F2 : Four_Bits;
+ F3 : Four_Bits;
+ F4 : Four_Bits;
+ end record;
+ for R16 use record
+ F1 at 0 range 0 .. 3;
+ F2 at 0 range 4 .. 7;
+ F3 at 0 range 8 .. 11;
+ F4 at 0 range 12 .. 15;
+ end record;
+
+ type R32 is record
+ F1 : Four_Bits;
+ F2 : Four_Bits;
+ F3 : Four_Bits;
+ F4 : Four_Bits;
+ F5 : Four_Bits;
+ F6 : Four_Bits;
+ F7 : Four_Bits;
+ F8 : Four_Bits;
+ end record;
+ for R32 use record
+ F1 at 0 range 0 .. 3;
+ F2 at 0 range 4 .. 7;
+ F3 at 0 range 8 .. 11;
+ F4 at 0 range 12 .. 15;
+ F5 at 0 range 16 .. 19;
+ F6 at 0 range 20 .. 23;
+ F7 at 0 range 24 .. 27;
+ F8 at 0 range 28 .. 31;
+ end record;
+
+ C_16 : constant R16 := (2, 3, 5, 7);
+ C_32 : constant R32 := (1, 1, 2, 3, 5, 8, 13, 5);
+
+ V_16 : R16;
+ pragma Atomic (V_16);
+ V_32 : R32;
+ pragma Atomic (V_32);
+
+end Atomic1_Pkg;