diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-05-08 11:38:26 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-05-08 11:38:26 +0000 |
commit | 9c026b8767d906ad9969f287152b237d9a20258e (patch) | |
tree | c9ff0be570529a9d26034693ee68985146adcd5f /gcc | |
parent | 35e2a4b8423dda850cb7898e30fdd75762226c4b (diff) | |
download | gcc-9c026b8767d906ad9969f287152b237d9a20258e.zip gcc-9c026b8767d906ad9969f287152b237d9a20258e.tar.gz gcc-9c026b8767d906ad9969f287152b237d9a20258e.tar.bz2 |
* gcc-interface/decl.c (make_aligning_type): Declare the type.
From-SVN: r159183
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/lto4.adb | 12 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/lto4.ads | 26 |
5 files changed, 53 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2a2805a..3878ccd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,9 @@ 2010-05-08 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (make_aligning_type): Declare the type. + +2010-05-08 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_entity): Create variables for size expressions of variant part of record types declared at library level. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index b0334f2..6df79fb 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -5955,8 +5955,8 @@ make_aligning_type (tree type, unsigned int align, tree size, if (TREE_CODE (name) == TYPE_DECL) name = DECL_NAME (name); - - TYPE_NAME (record_type) = concat_name (name, "_ALIGN"); + name = concat_name (name, "ALIGN"); + TYPE_NAME (record_type) = name; /* Compute VOFFSET and then POS. The next byte position multiple of some alignment after some address is obtained by "and"ing the alignment minus @@ -6001,8 +6001,12 @@ make_aligning_type (tree type, unsigned int align, tree size, size_int (room + align / BITS_PER_UNIT)); SET_TYPE_MODE (record_type, BLKmode); - relate_alias_sets (record_type, type, ALIAS_SET_COPY); + + /* Declare it now since it will never be declared otherwise. This is + necessary to ensure that its subtrees are properly marked. */ + create_type_decl (name, record_type, NULL, true, false, Empty); + return record_type; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a18a2b..08266b1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2010-05-08 Eric Botcazou <ebotcazou@adacore.com> + * gnat.dg/lto4.ad[sb]: New test. + +2010-05-08 Eric Botcazou <ebotcazou@adacore.com> + * gnat.dg/specs/lto3.ads: New test. * gnat.dg/specs/lto3_pkg1.ad[sb]: New helper. * gnat.dg/specs/lto3_pkg2.ad[sb]: Likewise. diff --git a/gcc/testsuite/gnat.dg/lto4.adb b/gcc/testsuite/gnat.dg/lto4.adb new file mode 100644 index 0000000..4e84b1d --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto4.adb @@ -0,0 +1,12 @@ +-- { dg-do compile } +-- { dg-options "-flto" } + +package body Lto4 is + + procedure SS_Allocate (Stack : Stack_Ptr) is + Chunk : Chunk_Ptr := Stack.Current_Chunk; + begin + Chunk := new Chunk_Id (First => Chunk.Last, Last => Chunk.Last); + end; + +end Lto4; diff --git a/gcc/testsuite/gnat.dg/lto4.ads b/gcc/testsuite/gnat.dg/lto4.ads new file mode 100644 index 0000000..36c9f94 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto4.ads @@ -0,0 +1,26 @@ +with System.Storage_Elements; + +package Lto4 is + + package SSE renames System.Storage_Elements; + + type SS_Ptr is new SSE.Integer_Address; + + type Memory is array (SS_Ptr range <>) of SSE.Storage_Element; + for Memory'Alignment use Standard'Maximum_Alignment; + + type Chunk_Id (First, Last : SS_Ptr) is record + Mem : Memory (First .. Last); + end record; + + type Chunk_Ptr is access all Chunk_Id; + + type Stack_Id is record + Current_Chunk : Chunk_Ptr; + end record; + + type Stack_Ptr is access Stack_Id; + + procedure SS_Allocate (Stack : Stack_Ptr); + +end Lto4; |