]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix miscompilation of predicate on bit-packed array types
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Jun 2021 11:29:32 +0000 (13:29 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Jun 2021 11:32:08 +0000 (13:32 +0200)
commit1eff5289b273041c9d71a4829c2600d283186ab6
tree53475464d16a5ccbeed81abf2cd3769041b4aa9b
parent592ed7db12ed0d6c71bca0cbfef6dcdf383bc24f
Fix miscompilation of predicate on bit-packed array types

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 for example.

gcc/ada/
* 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.
gcc/testsuite/
* gnat.dg/bit_packed_array6.adb: New test.
* gnat.dg/bit_packed_array6_pkg.ads: New helper.
gcc/ada/gcc-interface/decl.c
gcc/testsuite/gnat.dg/bit_packed_array6.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/bit_packed_array6_pkg.ads [new file with mode: 0644]