------- Additional Comments From wilson at specifixinc dot com 2005-02-19 23:15 ------- Subject: Re: gcc.dg/transparent-union-* fail on ia64-hpux
pinskia at gcc dot gnu dot org wrote: > ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-19 > 21:24 ------- > Hmm, Does anyone know how these union are supposed to be passed on > ia64-*-hpux, if by referrence > then the warning is correct and the testcase should not be tested on this > target. This is an ABI Issue. unions get passed right-aligned little-endian and left-aligned big-endian. Since linux is little-endian, and HPUX is big-endian, only HPUX has a problem here. HPUX defines MEMBER_TYPE_FORCES_BLK to make this work. There are other ways to solve this problem used by other targets, for instance, defining BLOCK_REG_PADDING for HPUX. Getting BLOCK_REG_PADDING to work can be tricky though. It looks like the ia64/hpux.h is the only one that defines MEMBER_TYPE_FORCES_BLK that can trigger this problem, since the others don't trigger on pointer or integer types. It appears that MEMBER_TYPE_FORCES_BLK should not be used for a transparent union, or should be used differently. This check could perhaps be done unconditionally in stor-layout.c. This might be a simple solution. Or maybe we can pass the union/structure type to MEMBER_TYPE_FORCES_BLK and modify the ia64/hpux.h version of the macro to check for the transparent_union attribute. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20094