aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 14:29:00 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 14:29:00 +0200
commit9fe696a3b387562aceca53cdf20f46e3bfe0d2b4 (patch)
tree9b257585b7a26bdfccae1bd31babb3d1658714ef /gcc/ada/exp_ch4.adb
parent635ffc52d8df885a6223c005144f7f3af541d960 (diff)
downloadgcc-9fe696a3b387562aceca53cdf20f46e3bfe0d2b4.zip
gcc-9fe696a3b387562aceca53cdf20f46e3bfe0d2b4.tar.gz
gcc-9fe696a3b387562aceca53cdf20f46e3bfe0d2b4.tar.bz2
[multiple changes]
2015-10-20 Bob Duff <duff@adacore.com> * s-mudido-affinity.adb (Create): Correct subranges of slices of CPU arrays. 2015-10-20 Arnaud Charlet <charlet@adacore.com> * sinfo.ads, g-pehage.adb, par-ch12.adb, layout.adb, exp_util.adb, sem_aux.adb, make.adb, checks.adb, sem_ch12.adb, sem_res.adb, sem_attr.adb, a-ngelfu.adb, sem_ch4.adb, switch-b.adb, sem_ch6.adb, prj-dect.adb, gnatxref.adb, sem_ch13.adb, lib-xref.adb: Fix typos. 2015-10-20 Tristan Gingold <gingold@adacore.com> * exp_ch4.adb (Expand_Array_Comparison): Use generic code if runtime routine is not available. From-SVN: r229071
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb58
1 files changed, 30 insertions, 28 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 8cfcb66..0e789f2 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -1533,37 +1533,43 @@ package body Exp_Ch4 is
end if;
end if;
- Remove_Side_Effects (Op1, Name_Req => True);
- Remove_Side_Effects (Op2, Name_Req => True);
+ if RTE_Available (Comp) then
- Rewrite (Op1,
- Make_Function_Call (Sloc (Op1),
- Name => New_Occurrence_Of (RTE (Comp), Loc),
+ -- Expand to a call only if the runtime function is available,
+ -- otherwise fallback to inline code.
- Parameter_Associations => New_List (
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Op1),
- Attribute_Name => Name_Address),
+ Remove_Side_Effects (Op1, Name_Req => True);
+ Remove_Side_Effects (Op2, Name_Req => True);
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Op2),
- Attribute_Name => Name_Address),
+ Rewrite (Op1,
+ Make_Function_Call (Sloc (Op1),
+ Name => New_Occurrence_Of (RTE (Comp), Loc),
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Op1),
- Attribute_Name => Name_Length),
+ Parameter_Associations => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Op1),
+ Attribute_Name => Name_Address),
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Op2),
- Attribute_Name => Name_Length))));
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Op2),
+ Attribute_Name => Name_Address),
- Rewrite (Op2,
- Make_Integer_Literal (Sloc (Op2),
- Intval => Uint_0));
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Op1),
+ Attribute_Name => Name_Length),
- Analyze_And_Resolve (Op1, Standard_Integer);
- Analyze_And_Resolve (Op2, Standard_Integer);
- return;
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Op2),
+ Attribute_Name => Name_Length))));
+
+ Rewrite (Op2,
+ Make_Integer_Literal (Sloc (Op2),
+ Intval => Uint_0));
+
+ Analyze_And_Resolve (Op1, Standard_Integer);
+ Analyze_And_Resolve (Op2, Standard_Integer);
+ return;
+ end if;
end if;
-- Cases where we cannot make runtime call
@@ -1620,10 +1626,6 @@ package body Exp_Ch4 is
Insert_Action (N, Func_Body);
Rewrite (N, Expr);
Analyze_And_Resolve (N, Standard_Boolean);
-
- exception
- when RE_Not_Available =>
- return;
end Expand_Array_Comparison;
---------------------------