aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-03-19 17:27:18 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-03-19 17:27:18 +0100
commita49565158271693fa8f994ba9b35f00b9ee25028 (patch)
treea928f3a0c12dc473d86f6fa4b138d002407c7f64
parent04398fa84e070560d18d59ffe898bd46e8ddbeb7 (diff)
downloadgcc-a49565158271693fa8f994ba9b35f00b9ee25028.zip
gcc-a49565158271693fa8f994ba9b35f00b9ee25028.tar.gz
gcc-a49565158271693fa8f994ba9b35f00b9ee25028.tar.bz2
[multiple changes]
2012-03-19 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch4.adb (Analyze_Allocator): Detect an allocator generated by the build-in-place machinery where the designated type is indefinite, but the underlying type is not. Do not emit errors related to missing initialization in this case. 2012-03-19 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add documentation for -gnateinnn switch. * sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting. * sem_prag.adb: Minor comment update. From-SVN: r185525
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/gnat_ugn.texi6
-rw-r--r--gcc/ada/lib-xref-alfa.adb6
-rw-r--r--gcc/ada/put_alfa.adb1
-rw-r--r--gcc/ada/sem_ch4.adb15
-rw-r--r--gcc/ada/sem_elab.adb3
-rw-r--r--gcc/ada/sem_prag.adb2
7 files changed, 38 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9fa56eb..956ff44 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,16 @@
+2012-03-19 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch4.adb (Analyze_Allocator): Detect an allocator generated
+ by the build-in-place machinery where the designated type is
+ indefinite, but the underlying type is not. Do not emit errors
+ related to missing initialization in this case.
+
+2012-03-19 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Add documentation for -gnateinnn switch.
+ * sem_elab.adb, put_alfa.adb, lib-xref-alfa.adb: Minor reformatting.
+ * sem_prag.adb: Minor comment update.
+
2012-03-15 Robert Dewar <dewar@adacore.com>
* errout.ads: Add entry for translating -gnateinn to
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 365a447..b8539f0 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -4155,6 +4155,12 @@ Display full source path name in brief error messages.
@cindex @option{-gnateG} (@command{gcc})
Save result of preprocessing in a text file.
+@item ^-gnatei^/MAX_INSTANTIATIONS=^@var{nnn}
+@cindex @option{-gnatei} (@command{gcc})
+Set maximum number of instantiations during compilation of a single unit to
+@var{nnn}. This may be useful in increasing the default maximum of 8000 for
+the rare case when a single unit legitimately exceeds this limit.
+
@item ^-gnateI^/MULTI_UNIT_INDEX=^@var{nnn}
@cindex @option{-gnateI} (@command{gcc})
Indicates that the source is a multi-unit source and that the index of the
diff --git a/gcc/ada/lib-xref-alfa.adb b/gcc/ada/lib-xref-alfa.adb
index c1c6b25..4961fed 100644
--- a/gcc/ada/lib-xref-alfa.adb
+++ b/gcc/ada/lib-xref-alfa.adb
@@ -211,10 +211,10 @@ package body Alfa is
procedure Add_Alfa_File (U : Unit_Number_Type; D : Nat) is
From : Scope_Index;
+ S : constant Source_File_Index := Source_Index (U);
- S : constant Source_File_Index := Source_Index (U);
-
- File_Name, Unit_File_Name : String_Ptr;
+ File_Name : String_Ptr;
+ Unit_File_Name : String_Ptr;
begin
-- Source file could be inexistant as a result of an error, if option
diff --git a/gcc/ada/put_alfa.adb b/gcc/ada/put_alfa.adb
index a5580a8..f4715bf 100644
--- a/gcc/ada/put_alfa.adb
+++ b/gcc/ada/put_alfa.adb
@@ -56,6 +56,7 @@ begin
Write_Info_Char ('-');
Write_Info_Char ('>');
Write_Info_Char (' ');
+
for N in F.Unit_File_Name'Range loop
Write_Info_Char (F.Unit_File_Name (N));
end loop;
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index ffc3a27..d56da36 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -661,9 +661,22 @@ package body Sem_Ch4 is
if Is_Indefinite_Subtype (Type_Id)
and then Serious_Errors_Detected = Sav_Errs
then
- if Is_Class_Wide_Type (Type_Id) then
+ -- The build-in-place machinery may produce an allocator when
+ -- the designated type is indefinite but the underlying type is
+ -- not. In this case the unknown discriminants are meaningless
+ -- and should not trigger error messages. Check the parent node
+ -- because the allocator is marked as coming from source.
+
+ if Present (Underlying_Type (Type_Id))
+ and then not Is_Indefinite_Subtype (Underlying_Type (Type_Id))
+ and then not Comes_From_Source (Parent (N))
+ then
+ null;
+
+ elsif Is_Class_Wide_Type (Type_Id) then
Error_Msg_N
("initialization required in class-wide allocation", N);
+
else
if Ada_Version < Ada_2005
and then Is_Limited_Type (Type_Id)
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 2656f46..4f28e1e 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -2620,13 +2620,10 @@ package body Sem_Elab is
if No (Nam) then
return Empty;
-
elsif Nkind (Nam) = N_Selected_Component then
return Entity (Selector_Name (Nam));
-
elsif not Is_Entity_Name (Nam) then
return Empty;
-
else
return Entity (Nam);
end if;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d55325a..1cd3590 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -3704,7 +3704,7 @@ package body Sem_Prag is
Check_At_Most_N_Arguments (1);
-- Modeled internally as
- -- pragma Unsuppress (Atomic_Synchronization [,Entity])
+ -- pragma Suppress/Unsuppress (Atomic_Synchronization [,Entity])
Rewrite (N,
Make_Pragma (Loc,