re PR c/87691 (transparent_union attribute does not work with MODE_PARTIAL_INT)
authorJozef Lawrynowicz <jozefl@gcc.gnu.org>
Wed, 7 Nov 2018 22:06:26 +0000 (22:06 +0000)
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>
Wed, 7 Nov 2018 22:06:26 +0000 (22:06 +0000)
commitc2ca29d5a35f8dd62f76df48e16bbac7320660c8
tree1ca8080d96fb6d191045c84771064ac19c0dd628
parente217792beda1ca48daea497c00694a3924f992c5
re PR c/87691 (transparent_union attribute does not work with MODE_PARTIAL_INT)

2018-11-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

PR c/87691

gcc/ChangeLog:
* stor-layout.c (compute_record_mode): Set TYPE_MODE of UNION_TYPE
to the mode of the widest field iff the widest field has mode class
MODE_INT, or MODE_PARTIAL_INT and the union would be passed by
reference.

gcc/testsuite/ChangeLog:
* gcc.target/msp430/pr87691.c: New test.

From-SVN: r265894
gcc/ChangeLog
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/msp430/pr87691.c [new file with mode: 0644]