This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
New test gcc.dg/torture/pr37868.c fails for -O[0123s] with: /usr/local/avrdev/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr37868.c:8: error: width of 'a' exceeds its type /usr/local/avrdev/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr37868.c:9: error: width of 'b' exceeds its type The test contains these declarations: struct X { unsigned char pad : 4; unsigned int a : 32; unsigned int b : 24; unsigned int c : 6; } __attribute__((packed)); An int on the AVR is 16-bits, hence the width of 'a' and 'b' exceed their type.
Test was added by: 2008-11-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/37868 * gcc.dg/torture/pr37868.c: New testcase. * gcc.c-torture/execute/pr38048-1.c: Likewise. * gcc.c-torture/execute/pr38048-2.c: Likewise.
gcc.dg/torture/pr37868.c should report the error..This is the positive test case for avr-gcc as the size of int = 16 bits,and in the struct X int bit field width is >16