re PR tree-optimization/52979 (likely wrong code bug w/packed bitfields)
authorJakub Jelinek <jakub@redhat.com>
Wed, 25 Apr 2012 14:27:08 +0000 (16:27 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 25 Apr 2012 14:27:08 +0000 (16:27 +0200)
commitf1cc958978c4b3a76ccf96571972f95963c9f0ea
tree81ecc613d94b359b676a0ac3492e351643109575
parent948e73b3d6a3d10ada7c0240bfbfa4aef147f59d
re PR tree-optimization/52979 (likely wrong code bug w/packed bitfields)

PR middle-end/52979
* stor-layout.c (get_best_mode): Don't return mode with bitsize
larger than maxbits.  Don't compute maxbits modulo align.
Also check that unit bytes long store at bitpos / unit * unit
doesn't affect bits beyond bitregion_end.
* expmed.c (store_bit_field_1): Avoid trying insv if OP_MODE MEM
would not fit into bitregion_start ... bitregion_end + 1 bit
region.
(store_split_bit_field): Decrease unit close to end of bitregion_end
if access is restricted in order to avoid mutual recursion.

* gcc.c-torture/compile/pr52979-1.c: New test.
* gcc.c-torture/execute/pr52979-1.c: New test.
* gcc.c-torture/execute/pr52979-2.c: New test.

From-SVN: r186819
gcc/ChangeLog
gcc/expmed.c
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr52979-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr52979-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr52979-2.c [new file with mode: 0644]