[Ada] Fix miscompilation of predicate on bit-packed array types

Eric Botcazou botcazou@adacore.com
Thu Jun 3 11:34:06 GMT 2021


This is a regression present on the mainline and 11 branch in the form of a
miscompilation by the new mod/ref IPA pass of code that passes constrained
bit-packed array objets in a call to a subprograms taking unconstrained bit-
packed array parameters, which occurs for predicate on bit-packed array types.

Tested on x86-64/Linux, applied on the mainline.


2021-06-03  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Add PAT
	local constant and use it throughout.  If it is set, use a ref-all
	pointer type for the pointer-to-array field of the fat pointer type.
	<E_Array_Subtype>: Add PAT local constant and use it throughout.


2021-06-03  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/bit_packed_array6.adb: New test.
	* gnat.dg/bit_packed_array6_pkg.ads: New helper.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 4353 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210603/3b09f3f0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bit_packed_array6_pkg.ads
Type: text/x-adasrc
Size: 393 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210603/3b09f3f0/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bit_packed_array6.adb
Type: text/x-adasrc
Size: 219 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210603/3b09f3f0/attachment-0002.bin>


More information about the Gcc-patches mailing list