aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-09-17 07:59:16 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-17 07:59:16 +0000
commit37915d022449d21fe7bfa7db640a15e77cd3352e (patch)
tree63d68b13e71558c24f9d2b3a8d47774eb456eb8f /gcc/ada/adaint.c
parent38b06e7a19d4002697117965d0bfce7ee77e1d40 (diff)
downloadgcc-37915d022449d21fe7bfa7db640a15e77cd3352e.zip
gcc-37915d022449d21fe7bfa7db640a15e77cd3352e.tar.gz
gcc-37915d022449d21fe7bfa7db640a15e77cd3352e.tar.bz2
[Ada] Fix wrong value of 'Size for slices of bit-packed arrays
This fixes a long-standing issue in the compiler which would return a wrong value for the Size attribute applied to slices of bit-packed arrays whose size is not a multiple of the storage unit. The problem is that the computation was done in the code generator after the bit-packed array had been internally rewritten into an array of bytes, so the Size was always rounded up to the next byte. The computation is now rewritten into the product of the Length and Compnent_Size attribute of the slices before being sent to the code generator. 2019-09-17 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_Size_Attribute): Chain the special cases on the back-end path and rewrite the attribute appled to slices of bit-packed arrays into the product of the Length and the Compoent_Size attributes of the slices. * exp_ch5.adb (Expand_Assign_Array_Bitfield): Use Size attribute directly to compute the bitfield's size. gcc/testsuite/ * gnat.dg/pack25.adb: New testcase. From-SVN: r275769
Diffstat (limited to 'gcc/ada/adaint.c')
0 files changed, 0 insertions, 0 deletions