stor-layout.c (finish_bitfield_representative): Fallback to conservative maximum...
authorRichard Guenther <rguenther@suse.de>
Tue, 20 Mar 2012 09:31:40 +0000 (09:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Mar 2012 09:31:40 +0000 (09:31 +0000)
commit7ebf9677e58b3f97e71f267e4f27bcaf01458393
tree0549509c3acd6070b5ca74672b96a9e435dd8bf6
parent9b96cf92a4334eccb74163397e94ade6e4acac48
stor-layout.c (finish_bitfield_representative): Fallback to conservative maximum size if the padding up to the next field...

2012-03-20  Richard Guenther  <rguenther@suse.de>

* stor-layout.c (finish_bitfield_representative): Fallback
to conservative maximum size if the padding up to the next
field cannot be computed as a constant.
(finish_bitfield_layout): If we cannot compute the distance
between the start of the bitfield representative and the
bitfield member start a new representative.
* expr.c (get_bit_range): The distance between the start of
the bitfield representative and the bitfield member is zero
if the field offsets are not constants.

* gnat.dg/pack16.adb: New testcase.
* gnat.dg/pack16_pkg.ads: Likewise.
* gnat.dg/specs/pack8.ads: Likewise.
* gnat.dg/specs/pack8_pkg.ads: Likewise.

From-SVN: r185563
gcc/ChangeLog
gcc/expr.c
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/pack16.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/pack16_pkg.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/pack8.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/pack8_pkg.ads [new file with mode: 0644]