$ cat ~/ice.i #pragma pack(1) struct S0 { volatile unsigned f0:11; signed f2:30; }; struct S1 { volatile struct S0 f7; }; struct S1 a, b; void bar () { foo (a.f7.f0) && foo (b.f7.f2); } $ ./xgcc -v Using built-in specs. COLLECT_GCC=./xgcc Target: arm-unknown-linux-gnueabi Configured with: ../configure --target=arm-unknown-linux-gnueabi --prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi --with-sysroot=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root --disable-multilib --with-local-prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace target_alias=arm-unknown-linux-gnueabi --enable-languages=c++ --disable-shared --disable-libmudflap --disable-libssp Thread model: posix gcc version 4.7.0 20110517 (experimental) [trunk revision 173832] (GCC) $ ./xgcc -B. ~/ice.i /home/ryan/ice.i: In function 'bar': /home/ryan/ice.i:19:29: internal compiler error: in simplify_subreg, at simplify-rtx.c:5266 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Update host/target fields
I can reproduce with the trunk and 4.6 branch, works with 4.4, assuming it started with -fstrict-volatile-bitfields addition.
Created attachment 24281 [details] gcc46-pr49029.patch Untested fix. I can bootstrap/regtest this on x86_64 and i686, but can't on arm. Can anyone please test it there?
Author: jakub Date: Sun May 22 19:00:00 2011 New Revision: 174034 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174034 Log: PR middle-end/49029 * expmed.c (extract_fixed_bit_field): Test whether target can be used only after deciding which mode to use. * gcc.c-torture/compile/pr49029.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr49029.c Modified: trunk/gcc/ChangeLog trunk/gcc/expmed.c trunk/gcc/testsuite/ChangeLog
Author: jakub Date: Sun May 22 19:02:59 2011 New Revision: 174036 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174036 Log: PR middle-end/49029 * expmed.c (extract_fixed_bit_field): Test whether target can be used only after deciding which mode to use. * gcc.c-torture/compile/pr49029.c: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr49029.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/expmed.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Hopefully fixed.
For 4.6.1 release, the corresponding testcase from regression fails for AVR target... /home/anitha/patch-upgrade/gcc-4.6.1/gcc/testsuite/gcc.c-torture/compile/pr49029.c:2:8: error: width of 'g' exceeds its type compiler exited with status 1 FAIL: gcc.c-torture/compile/pr49029.c -O0 (test for excess errors) Compiler specs -------------- Using built-in specs. COLLECT_GCC=avr-gcc COLLECT_LTO_WRAPPER=/home/anitha/install/libexec/gcc/avr/4.6.1/lto-wrapper Target: avr Configured with: ../configure --prefix=/home/anitha/install --target=avr --with-gmp=/proj/install/gmp-4.3.2/ --with-mpfr=/proj/install/mpfr-2.4.2/ --with-mpc=/proj/install/mpc-0.8.2/ --enable-languages=c,c++ --disable-libssp --disable-nls --with-dwarf2 Thread model: single gcc version 4.6.1 (GCC)