aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-06-06 10:21:58 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-06-06 10:21:58 +0000
commite9f57686fcfaf04788a27d6433e7bf727d08001c (patch)
tree58ca3843861d0db20c5609c5d70894d34d72aa5b /gcc/ada
parent10e4d0563e0862eaf29529134cc7b6495fecaa51 (diff)
downloadgcc-e9f57686fcfaf04788a27d6433e7bf727d08001c.zip
gcc-e9f57686fcfaf04788a27d6433e7bf727d08001c.tar.gz
gcc-e9f57686fcfaf04788a27d6433e7bf727d08001c.tar.bz2
trans.c (Identifier_to_gnu): Also handle deferred constants whose full view has discriminants specially.
* gcc-interface/trans.c (Identifier_to_gnu): Also handle deferred constants whose full view has discriminants specially. From-SVN: r174689
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/trans.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1ea386b..6587ffd 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
2011-06-06 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/trans.c (Identifier_to_gnu): Also handle deferred
+ constants whose full view has discriminants specially.
+
+2011-06-06 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/utils.c: Include diagnostic.h.
(gnat_write_global_declarations): Output debug information for all
global type declarations before finalizing the compilation unit.
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 5f08877..ca47e93 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -906,9 +906,11 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
attribute Position, generated for dispatching code (see Make_DT in
exp_disp,adb). In that case we need the type itself, not is parent,
in particular if it is a derived type */
- if (Is_Private_Type (gnat_temp_type)
- && Has_Unknown_Discriminants (gnat_temp_type)
- && Ekind (gnat_temp) == E_Constant
+ if (Ekind (gnat_temp) == E_Constant
+ && Is_Private_Type (gnat_temp_type)
+ && (Has_Unknown_Discriminants (gnat_temp_type)
+ || (Present (Full_View (gnat_temp_type))
+ && Has_Discriminants (Full_View (gnat_temp_type))))
&& Present (Full_View (gnat_temp)))
{
gnat_temp = Full_View (gnat_temp);