https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116832
Bug ID: 116832
Summary: Code after a select-then-abort in an abortable part
executes when the outer select-then-abort completes
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: liam at liampwll dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
As shown by the code below, code after a select-then-abort in an abortable part
executes when the outer select-then-abort completes. This only occurs when B is
a protected object rather than a task. This is potentially related to bug
52280, which is still reproducible. This occurs on trunk, 14.2.1, and 8.2.
Other versions are untested.
with Ada.Text_IO; use Ada.Text_IO;
procedure Example is
task A is
entry A;
end A;
protected B is
entry B;
end B;
task body A is
begin
delay 3.0;
accept A;
end A;
protected body B is
entry B when False is
begin
Ada.Text_IO.Put_Line ("This correctly never executes.");
end B;
end B;
begin
select
A.A;
then abort
select
B.B;
then abort
B.B;
end select;
Ada.Text_IO.Put_Line ("This should be unreachable but it executes.");
end select;
end Example;