summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-11-05 17:19:35 +0000
committerRichard Sandiford <richard.sandiford@linaro.org>2017-11-05 17:19:35 +0000
commit648f8fc59b2cc39abd24f4c22388b346cdebcc31 (patch)
tree3a07eccc4c22b265261edd75c9ec3910d9c626f5 /gcc/ada/exp_ch4.adb
parent7bef5b82e4109778a0988d20e19e1ed29dadd835 (diff)
parent8c089b5c15a7b35644750ca393f1e66071ad9aa9 (diff)
downloadgcc-648f8fc59b2cc39abd24f4c22388b346cdebcc31.tar.gz
Merge trunk into sve
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 770341ce9eb..abf6d635451 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -1069,12 +1069,15 @@ package body Exp_Ch4 is
-- object can be limited but not inherently limited if this allocator
-- came from a return statement (we're allocating the result on the
-- secondary stack). In that case, the object will be moved, so we do
- -- want to Adjust.
+ -- want to Adjust. However, if it's a nonlimited build-in-place
+ -- function call, Adjust is not wanted.
if Needs_Finalization (DesigT)
and then Needs_Finalization (T)
and then not Aggr_In_Place
and then not Is_Limited_View (T)
+ and then not Alloc_For_BIP_Return (N)
+ and then not Is_Build_In_Place_Function_Call (Expression (N))
then
-- An unchecked conversion is needed in the classwide case because
-- the designated type can be an ancestor of the subtype mark of
@@ -5561,6 +5564,7 @@ package body Exp_Ch4 is
declare
Cnn : constant Entity_Id := Make_Temporary (Loc, 'C', N);
Ptr_Typ : constant Entity_Id := Make_Temporary (Loc, 'A');
+
begin
-- Generate:
-- type Ann is access all Typ;
@@ -5638,6 +5642,7 @@ package body Exp_Ch4 is
then
declare
Cnn : constant Node_Id := Make_Temporary (Loc, 'C', N);
+
begin
Insert_Action (N,
Make_Object_Declaration (Loc,
@@ -5678,6 +5683,7 @@ package body Exp_Ch4 is
declare
Cnn : constant Node_Id := Make_Temporary (Loc, 'C', N);
+
begin
Decl :=
Make_Object_Declaration (Loc,