summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch11.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 13:18:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 13:18:56 +0000
commitd0a7d0511226c237e403ae2994c4c49454071568 (patch)
treec9d39f5c1dc6694d684b73adfb8887c02f034c9a /gcc/ada/exp_ch11.adb
parentf838475178aa1557660dbb431af5d7d90e3e78e6 (diff)
downloadgcc-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
Diffstat (limited to 'gcc/ada/exp_ch11.adb')
-rw-r--r--gcc/ada/exp_ch11.adb37
1 files changed, 28 insertions, 9 deletions
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;