aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-07-29 13:11:55 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 15:11:55 +0200
commita08bf2de29311011ebdfe1454afb832b0cdbb453 (patch)
treefd167988bfb3ee4c2e970cfc1afc024fba592b18
parentb8b2d9829aa9c3caa053de687701de3ebb506b4c (diff)
downloadgcc-a08bf2de29311011ebdfe1454afb832b0cdbb453.zip
gcc-a08bf2de29311011ebdfe1454afb832b0cdbb453.tar.gz
gcc-a08bf2de29311011ebdfe1454afb832b0cdbb453.tar.bz2
freeze.adb (Freeze_Entity, [...]): Add a guard to make sure that the Etype of a component of the corresponding...
2014-07-29 Robert Dewar <dewar@adacore.com> * freeze.adb (Freeze_Entity, Concurrent_Type case): Add a guard to make sure that the Etype of a component of the corresponding record type is present before trying to freeze it. * sem_ch5.adb: Minor reformatting. From-SVN: r213165
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/freeze.adb18
-rw-r--r--gcc/ada/sem_ch5.adb1
3 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2ccfdf4..917f4be 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,12 @@
2014-07-29 Robert Dewar <dewar@adacore.com>
+ * freeze.adb (Freeze_Entity, Concurrent_Type case): Add a guard
+ to make sure that the Etype of a component of the corresponding
+ record type is present before trying to freeze it.
+ * sem_ch5.adb: Minor reformatting.
+
+2014-07-29 Robert Dewar <dewar@adacore.com>
+
* exp_attr.adb, types.ads, types.h, exp_ch11.adb, a-except.adb,
a-except-2005.adb: Add new reason code PE_Stream_Operation_Not_Allowed,
and then use it when a stream operation is used from a library generic
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index ddd162f..9aee0a1 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -4710,13 +4710,19 @@ package body Freeze is
Freeze_And_Append (Comp, N, Result);
elsif (Ekind (Comp)) /= E_Function then
- if Is_Itype (Etype (Comp))
- and then Underlying_Type (Scope (Etype (Comp))) = E
- then
- Undelay_Type (Etype (Comp));
- end if;
- Freeze_And_Append (Etype (Comp), N, Result);
+ -- The guard on the presence of the Etype seems to be needed
+ -- for some CodePeer (-gnatcC) cases, but not clear why???
+
+ if Present (Etype (Comp)) then
+ if Is_Itype (Etype (Comp))
+ and then Underlying_Type (Scope (Etype (Comp))) = E
+ then
+ Undelay_Type (Etype (Comp));
+ end if;
+
+ Freeze_And_Append (Etype (Comp), N, Result);
+ end if;
end if;
Next_Entity (Comp);
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 3ac6e6b..c52f242 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -3184,6 +3184,7 @@ package body Sem_Ch5 is
-- We skip this step if we are not in code generation mode
-- or CodePeer mode.
+
-- This is the one case where we remove dead code in the
-- semantics as opposed to the expander, and we do not want
-- to remove code if we are not in code generation mode,