diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 13:18:56 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 13:18:56 +0000 |
commit | d0a7d0511226c237e403ae2994c4c49454071568 (patch) | |
tree | c9d39f5c1dc6694d684b73adfb8887c02f034c9a | |
parent | f838475178aa1557660dbb431af5d7d90e3e78e6 (diff) | |
download | gcc-d0a7d0511226c237e403ae2994c4c49454071568.tar.gz |
2009-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_User_Defined_Binary_Op): If left operand is
overloaded and one interpretation matches the context, label the
operand with the type of first formal.
2009-04-20 Bob Duff <duff@adacore.com>
* debug.ads: Minor comment fix.
* debug.adb: Minor comment fixes.
2009-04-20 Javier Miranda <miranda@adacore.com>
* rtsfind.ads (RE_Null_Id): New entity of package Ada.Exceptions
* exp_ch6.adb (Expand_Inlined_Call): Undo previous patch.
* exp_ch11.adb (Expand_N_Raise_Statement): When the raise stmt
is expanded into a call to Raise_Exception, avoid passing the
exception-name'identity in runtimes in which this argument
is not used.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146416 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/ada/debug.adb | 8 | ||||
-rw-r--r-- | gcc/ada/debug.ads | 15 | ||||
-rw-r--r-- | gcc/ada/exp_ch11.adb | 37 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 11 | ||||
-rw-r--r-- | gcc/ada/rtsfind.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 12 |
7 files changed, 77 insertions, 31 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6a2a01201ff..98d2def2590 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,26 @@ +2009-04-20 Ed Schonberg <schonberg@adacore.com> + + * sem_ch4.adb (Analyze_User_Defined_Binary_Op): If left operand is + overloaded and one interpretation matches the context, label the + operand with the type of first formal. + +2009-04-20 Bob Duff <duff@adacore.com> + + * debug.ads: Minor comment fix. + + * debug.adb: Minor comment fixes. + +2009-04-20 Javier Miranda <miranda@adacore.com> + + * rtsfind.ads (RE_Null_Id): New entity of package Ada.Exceptions + + * exp_ch6.adb (Expand_Inlined_Call): Undo previous patch. + + * exp_ch11.adb (Expand_N_Raise_Statement): When the raise stmt + is expanded into a call to Raise_Exception, avoid passing the + exception-name'identity in runtimes in which this argument + is not used. + 2009-04-20 Jerome Lambourg <lambourg@adacore.com> * impunit.adb: Add i-cil and i-cilobj packages, now needed by the diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index a37d4f0b6e8..462975607df 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -191,7 +191,7 @@ package body Debug is -- dc -- dd -- de - -- df + -- df Only output file names, not path names, in log -- dg -- dh -- di @@ -428,8 +428,6 @@ package body Debug is -- in preelaborable packages, but this restriction is a huge pain, -- especially in the predefined library units. - -- dQ needs full documentation ??? - -- dR Bypass the check for a proper version of s-rpc being present -- to use the -gnatz? switch. This allows debugging of the use -- of stubs generation without needing to have GLADE (or some @@ -612,6 +610,10 @@ package body Debug is -- be listed, and is useful when diagnosing circularities introduced -- by incorrect changes to the run-time library itself. + -- db Output debug information from Better_Choice in Binde, which uses + -- various heuristics to determine elaboration order in cases where + -- multiple orders are valid. + -- dc List units as they are chosen. As units are selected for addition to -- the elaboration order, a line of output is generated showing which -- unit has been selected. diff --git a/gcc/ada/debug.ads b/gcc/ada/debug.ads index 53d07204780..9ebaa52cfb0 100644 --- a/gcc/ada/debug.ads +++ b/gcc/ada/debug.ads @@ -40,14 +40,13 @@ package Debug is -- Dynamic Debug Flags -- ------------------------- - -- Sixty two flags that can be used to active various specialized - -- debugging output information. The flags are preset to False, which - -- corresponds to the given output being suppressed. The individual - -- flags can be turned on using the undocumented switch dxxx where - -- xxx is a string of letters for flags to be turned on. Documentation - -- on the current usage of these flags is contained in the body of Debug - -- rather than the spec, so that we don't have to recompile the world - -- when a new debug flag is added + -- Flags that can be used to active various specialized debugging output + -- information. The flags are preset to False, which corresponds to the + -- given output being suppressed. The individual flags can be turned on + -- using the undocumented switch dxxx where xxx is a string of letters for + -- flags to be turned on. Documentation on the current usage of these flags + -- is contained in the body of Debug rather than the spec, so that we don't + -- have to recompile the world when a new debug flag is added. Debug_Flag_A : Boolean := False; Debug_Flag_B : Boolean := False; diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index a7b6fe1a905..961716685b5 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -35,9 +35,9 @@ with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; -with Rtsfind; use Rtsfind; with Restrict; use Restrict; with Rident; use Rident; +with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Ch8; use Sem_Ch8; with Sem_Res; use Sem_Res; @@ -1407,14 +1407,33 @@ package body Exp_Ch11 is -- and there is nothing else to do. if Present (Expression (N)) then - Rewrite (N, - Make_Procedure_Call_Statement (Loc, - Name => New_Occurrence_Of (RTE (RE_Raise_Exception), Loc), - Parameter_Associations => New_List ( - Make_Attribute_Reference (Loc, - Prefix => Name (N), - Attribute_Name => Name_Identity), - Expression (N)))); + + -- Avoid passing exception-name'identity in runtimes in which this + -- argument is not used. This avoids generating undefined references + -- to these exceptions when compiling with no optimization + + if Configurable_Run_Time_On_Target + and then (Restriction_Active (No_Exception_Handlers) + or else + Restriction_Active (No_Exception_Propagation)) + then + Rewrite (N, + Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (RTE (RE_Raise_Exception), Loc), + Parameter_Associations => New_List ( + New_Occurrence_Of (RTE (RE_Null_Id), Loc), + Expression (N)))); + else + Rewrite (N, + Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (RTE (RE_Raise_Exception), Loc), + Parameter_Associations => New_List ( + Make_Attribute_Reference (Loc, + Prefix => Name (N), + Attribute_Name => Name_Identity), + Expression (N)))); + end if; + Analyze (N); return; end if; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 989dc1acdb5..82311e1bc60 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -3670,16 +3670,6 @@ package body Exp_Ch6 is return; end if; - -- Avoid generation of temporaries for unreferenced formals - - -- What is going on here ??? test below is for *PRAGMA* unreferenced - -- not for an unreferenced formal. Is this a bug fix, or simply an - -- optimization. Needs comment fix and explanation ??? - - if Has_Pragma_Unreferenced (F) then - goto Continue; - end if; - -- If the argument may be a controlling argument in a call within -- the inlined body, we must preserve its classwide nature to insure -- that dynamic dispatching take place subsequently. If the formal @@ -3800,7 +3790,6 @@ package body Exp_Ch6 is Set_Renamed_Object (F, Temp); end if; - <<Continue>> Next_Formal (F); Next_Actual (A); end loop; diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index dd655ac3d8d..95b717ffcfc 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -490,6 +490,7 @@ package Rtsfind is RE_Exception_Message, -- Ada.Exceptions RE_Exception_Name_Simple, -- Ada.Exceptions RE_Exception_Occurrence, -- Ada.Exceptions + RE_Null_Id, -- Ada.Exceptions RE_Null_Occurrence, -- Ada.Exceptions RE_Poll, -- Ada.Exceptions RE_Raise_Exception, -- Ada.Exceptions @@ -1652,6 +1653,7 @@ package Rtsfind is RE_Exception_Message => Ada_Exceptions, RE_Exception_Name_Simple => Ada_Exceptions, RE_Exception_Occurrence => Ada_Exceptions, + RE_Null_Id => Ada_Exceptions, RE_Null_Occurrence => Ada_Exceptions, RE_Poll => Ada_Exceptions, RE_Raise_Exception => Ada_Exceptions, diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 43c86e57037..5ea961b1ae1 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -3918,6 +3918,18 @@ package body Sem_Ch4 is then Add_One_Interp (N, Op_Id, Etype (Op_Id)); + -- If the left operand is overloaded, indicate that the + -- current type is a viable candidate. This is redundant + -- in most cases, but for equality and comparison operators + -- where the context does not impose a type on the operands, + -- setting the proper type is necessary to avoid subsequent + -- ambiguities during resolution, when both user-defined and + -- predefined operators may be candidates. + + if Is_Overloaded (Left_Opnd (N)) then + Set_Etype (Left_Opnd (N), Etype (F1)); + end if; + if Debug_Flag_E then Write_Str ("user defined operator "); Write_Name (Chars (Op_Id)); |