------- Comment #11 from borntraeger at de dot ibm dot com 2010-07-25 16:54 ------- Something like the following should do the trick. Is endian.h available on all supported platforms?
*** gcc.c-torture/execute/pr45017.c.orig --- gcc.c-torture/execute/pr45017.c *************** *** 1,9 **** --- 1,17 ---- + #include <endian.h> + int tester(char *bytes) { union { struct { + # if __BYTE_ORDER == __BIG_ENDIAN + unsigned int r2:4; + unsigned int r1:4; + # endif + # if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int r1:4; unsigned int r2:4; + # endif } fmt; char value[1]; } ovl; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45017