From b7cb4a617fd5fd4ec69eedf3790f5c9ef836f0d7 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 29 Jan 2014 16:37:54 +0100 Subject: [PATCH] [multiple changes] 2014-01-29 Javier Miranda * exp_ch3.adb (Predefined_Primitive_Bodies): Complete the code that checks if an interface types defines the predefined "=" function because the compiler was erroneously not generating the predefined "=" primitive as soon as the name of some interface primitive is "=" (formals were not checked). 2014-01-29 Ed Schonberg * expander.adb (Expander): In GNATprove mode, do not process transient scopes: they are in general not created in this mode, and an attempt to examine them will lead to constraint errors when processing configuration pragmas that have analyzable expressions. From-SVN: r207256 --- gcc/ada/ChangeLog | 15 +++++++++++++++ gcc/ada/exp_ch3.adb | 9 +++++++++ gcc/ada/expander.adb | 5 +++++ 3 files changed, 29 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 57624ead7c1..1d0515d3cbf 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2014-01-29 Javier Miranda + + * exp_ch3.adb (Predefined_Primitive_Bodies): Complete the code + that checks if an interface types defines the predefined "=" + function because the compiler was erroneously not generating the + predefined "=" primitive as soon as the name of some interface + primitive is "=" (formals were not checked). + +2014-01-29 Ed Schonberg + + * expander.adb (Expander): In GNATprove mode, do not process + transient scopes: they are in general not created in this mode, + and an attempt to examine them will lead to constraint errors when + processing configuration pragmas that have analyzable expressions. + 2014-01-29 Vincent Celier * clean.adb (Gnatclean): Fail if main project is an aggregate diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index d055831e34b..3dfd39084cd 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -9642,6 +9642,15 @@ package body Exp_Ch3 is while Present (Prim) loop if Chars (Node (Prim)) = Name_Op_Eq and then not Is_Internal (Node (Prim)) + and then Present (First_Entity (Node (Prim))) + + -- Following tests need a comment ??? + + and then Present (Last_Entity (Node (Prim))) + and then Next_Entity (First_Entity (Node (Prim))) + = Last_Entity (Node (Prim)) + and then Etype (First_Entity (Node (Prim))) = Tag_Typ + and then Etype (Last_Entity (Node (Prim))) = Tag_Typ then Eq_Needed := False; Eq_Name := No_Name; diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb index 869c16c899b..6ed3e63d864 100644 --- a/gcc/ada/expander.adb +++ b/gcc/ada/expander.adb @@ -129,9 +129,14 @@ package body Expander is -- In GNATprove mode we only need a very limited subset of -- the usual expansions. This limited subset is implemented -- in Expand_SPARK. + -- Regular expansion is followed by special handling for transient + -- scopes for unconstrained results, etc. but this is not needed, + -- and in general cannot be done correctly, in this mode. if GNATprove_Mode then Expand_SPARK (N); + Set_Analyzed (N); + return; -- Here for normal non-SPARK mode -- 2.30.2