aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-10-02 20:16:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-10-02 20:16:18 +0000
commit5004b2347d2b300302d11dcf95e53e610c6c33aa (patch)
tree40b5d1e4c2dc203a6c690b49915b38af85291282 /gcc
parent1aa8b1dd138a0b4aec3bc5747b7298475335e4d7 (diff)
downloadgcc-5004b2347d2b300302d11dcf95e53e610c6c33aa.zip
gcc-5004b2347d2b300302d11dcf95e53e610c6c33aa.tar.gz
gcc-5004b2347d2b300302d11dcf95e53e610c6c33aa.tar.bz2
decl.c (check_ok_for_atomic): Do nothing if the type doesn't come from source.
* gcc-interface/decl.c (check_ok_for_atomic): Do nothing if the type doesn't come from source. From-SVN: r152418
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/atomic2.adb11
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 967e4f0..1a86ebd 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (check_ok_for_atomic): Do nothing if the type
+ doesn't come from source.
+
+2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (gnat_to_gnu_component_type): Force at least
unit size for the component size of an array with aliased components.
(maybe_pad_type): Do not warn for MAX_EXPR.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 22ee89e..a6c1672 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -7868,6 +7868,11 @@ check_ok_for_atomic (tree object, Entity_Id gnat_entity, bool comp_p)
OBJECT is either a type or a decl. */
if (TYPE_P (object))
{
+ /* If this is an anonymous base type, nothing to check. Error will be
+ reported on the source type. */
+ if (!Comes_From_Source (gnat_entity))
+ return;
+
mode = TYPE_MODE (object);
align = TYPE_ALIGN (object);
size = TYPE_SIZE (object);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f2dba40..e40e71d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/atomic2.adb: New test.
+
+2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/array11.adb: New test.
* gnat.dg/array12.adb: Likewise.
diff --git a/gcc/testsuite/gnat.dg/atomic2.adb b/gcc/testsuite/gnat.dg/atomic2.adb
new file mode 100644
index 0000000..c14d21e
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/atomic2.adb
@@ -0,0 +1,11 @@
+-- { dg-do compile }
+
+procedure Atomic2 is
+
+ type Big is array (1..4) of Integer;
+ type Arr is array (1..10) of Big;
+ pragma Atomic_Components (Arr); -- { dg-warning "cannot be guaranteed" }
+
+begin
+ null;
+end;