]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Undefined master in task with limited class-wide aliased entry formal
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:30:17 +0000 (08:30 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2019 08:30:17 +0000 (08:30 +0000)
commitb70180f1ee63557b23cab2891508601823bf28a3
tree06a399da578e75da19912bb717f56682679b5449
parentc315a4384c497648aa618a517a059198feef0988
[Ada] Undefined master in task with limited class-wide aliased entry formal

In the case of a task declaring an entry with an aliased formal
parameter of a limited class-wide type, the front end was creating a
master object (_master) for the access type generated for such an entry
formal inside the task specification, even though such access types
don't need an associated master.  The master object wasn't being copied
into the procedure expanded for the task body, but a renaming for the
master appeared in the statements of the task body, and the LLVM back
end rejects this since the master object doesn't appear in the expanded
task procedure (for some reason, gigi doesn't complain). This is fixed
by suppressing the creation of the master object in the case where the
access-to-limited-class-wide access type is the type of a component in
an entry's parameter block.  This is similar to the suppression done for
the master object in other cases, where the access type designates a
type explicitly containing tasks (though the suppression involves
testing Comes_From_Source in that case).

No simple test (and this only affects the LLVM-based compiler).

2019-08-21  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* exp_ch3.adb (Build_Master): Suppress call to
Build_Class_Wide_Master in the case where the
access-to-limited-class-wide type was created for a component in
an entry's formal parameter
block (Is_Parameter_Block_Component_Type), to prevent a master
from being created for such access types generated by the front
end in a task spec for entry formals in a parameter block.  Add
a ??? about whether this suppression should be done more
generally (such as by using Comes_From_Source).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274783 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb