aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-01-09 11:06:23 +0100
committerEric Botcazou <ebotcazou@adacore.com>2024-01-09 11:06:23 +0100
commit8f80b9f0904eb98b41913068ce7dc021c2f35ecc (patch)
tree8c6a32273d3d3af695e122d0b6aeb58d15887993 /gcc/testsuite/c-c++-common
parent436ce7a3510000e0939094592fc12353e17527f1 (diff)
downloadgcc-8f80b9f0904eb98b41913068ce7dc021c2f35ecc.zip
gcc-8f80b9f0904eb98b41913068ce7dc021c2f35ecc.tar.gz
gcc-8f80b9f0904eb98b41913068ce7dc021c2f35ecc.tar.bz2
Fix internal error on function call returning extension of limited interface
The problem occurs when this function call is the expression of a return in a function returning the limited interface; in this peculiar case, there is a mismatch between the callee, which has BIP formals but is not a BIP call, and the caller, which is a BIP function, that is spotted by an assertion. This is fixed by restoring the semantics of Is_Build_In_Place_Function_Call, which returns again true only for calls to BIP functions, introducing the Is_Function_Call_With_BIP_Formals predicate, which also returns true for calls to functions with BIP formals that are not BIP functions, and moving down the assertion in Expand_Simple_Function_Return. gcc/ada/ PR ada/112781 * exp_ch6.ads (Is_Build_In_Place_Function): Adjust description. * exp_ch6.adb (Is_True_Build_In_Place_Function_Call): Delete. (Is_Function_Call_With_BIP_Formals): New predicate. (Is_Build_In_Place_Function_Call): Restore original semantics. (Expand_Call_Helper): Adjust conditions guarding the calls to Add_Dummy_Build_In_Place_Actuals to above renaming. (Expand_N_Extended_Return_Statement): Adjust to above renaming. (Expand_Simple_Function_Return): Likewise. Move the assertion to after the transformation into an extended return statement. (Make_Build_In_Place_Call_In_Allocator): Remove unreachable code. (Make_Build_In_Place_Call_In_Assignment): Likewise. gcc/testsuite/ * gnat.dg/bip_prim_func2.adb: New test. * gnat.dg/bip_prim_func2_pkg.ads, gnat.dg/bip_prim_func2_pkg.adb: New helper package.
Diffstat (limited to 'gcc/testsuite/c-c++-common')
0 files changed, 0 insertions, 0 deletions