aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-02-11 19:18:46 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-21 09:27:56 +0200
commitbc54f5b8b21114c7f63f4b318f36d63026add3b6 (patch)
treef1299ceb692c2b58e7a8b22c56d5c9652f895520 /gcc/ada/gcc-interface
parente49eac82e805ede5dd9b3c5d4ae9f8d90b0cc034 (diff)
downloadgcc-bc54f5b8b21114c7f63f4b318f36d63026add3b6.zip
gcc-bc54f5b8b21114c7f63f4b318f36d63026add3b6.tar.gz
gcc-bc54f5b8b21114c7f63f4b318f36d63026add3b6.tar.bz2
ada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc
The deallocation call of the return and secondary stacks no longer matches the profile built in Exp_Util.Build_Allocate_Deallocate_Proc, so this just removes the code as unreachable and adds an assertion to that effect. gcc/ada/ * gcc-interface/utils2.cc (build_call_alloc_dealloc_proc): Add an assertion that this is not a deallocation of the return or secondary stack and remove subsequent unreachable code.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/utils2.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc
index fb0ccf5..64712cb 100644
--- a/gcc/ada/gcc-interface/utils2.cc
+++ b/gcc/ada/gcc-interface/utils2.cc
@@ -2187,15 +2187,16 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type,
= Etype (Next_Formal (First_Formal (gnat_proc)));
tree gnu_size_type = gnat_to_gnu_type (gnat_size_type);
+ /* Deallocation is not supported for return and secondary stacks. */
+ gcc_assert (!gnu_obj);
+
gnu_size = convert (gnu_size_type, gnu_size);
gnu_align = convert (gnu_size_type, gnu_align);
if (DECL_BUILT_IN_CLASS (gnu_proc) == BUILT_IN_FRONTEND
&& DECL_FE_FUNCTION_CODE (gnu_proc) == BUILT_IN_RETURN_SLOT)
{
- /* This must be an allocation of the return stack in a function that
- returns by invisible reference. */
- gcc_assert (!gnu_obj);
+ /* This must be a function that returns by invisible reference. */
gcc_assert (current_function_decl
&& TREE_ADDRESSABLE (TREE_TYPE (current_function_decl)));
tree gnu_ret_size;
@@ -2221,11 +2222,6 @@ build_call_alloc_dealloc_proc (tree gnu_obj, tree gnu_size, tree gnu_type,
N_Raise_Program_Error));
}
- /* The first arg is the address of the object, for a deallocator,
- then the size. */
- else if (gnu_obj)
- gnu_call = build_call_n_expr (gnu_proc, 2, gnu_obj, gnu_size);
-
else
gnu_call = build_call_n_expr (gnu_proc, 2, gnu_size, gnu_align);
}