https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87691
--- Comment #1 from Jozef Lawrynowicz <jozef.l at mittosystems dot com> --- The issue is that the union is considered to have size of 32 bits (the in-memory size of __int20), so unless mode_for_size as called by compute_record_mode (both in stor-layout.c) is explicitly told to look for a mode of class MODE_PARTIAL_INT, then a size of 32 will always return MODE_INT. In this case, the union will have TYPE_MODE of SImode, but its field is PSImode, so transparent_union has no effect. As was explained on the GCC mailing list (https://gcc.gnu.org/ml/gcc/2018-05/msg00218.html), in general we want to ensure that the class of a union is MODE_INT, as some ABIs mandate that unions be passed in integer registers. For msp430, it is fine to relax this constraint and allow unions to have PSImode, as all general purpose registers are 20-bits (and msp430 doesn't pass structs/unions by value anyway). The attached patch fixes the issue by requesting a mode of class MODE_PARTIAL_INT when calling mode_for_size in compute_record_mode. However, since other targets which support MODE_PARTIAL_INT may want unions to always have class MODE_INT, I wonder if the attached patch is not appropriate. Should there perhaps be a target hook which allows/disallows MODE_PARTIAL_INT structs/unions?