I was reworking an existing AVR application for C89 compatibility, and while doing so, found an internal compiler error while dealing with inline assembly. I have taken the offending function and trimmed the code to a minimum for a test. Output is as follows: test.c: In function 'spi_manual_send_ass_GCC_BUGGY': test.c:22: internal compiler error: in ptrreg_to_str, at config/avr/avr.c:1009 Please submit a full bug report, with preprocessed source if appropriate. The preprocessed source of test.i is appended: # 1 "test.c" # 1 "<built-in>" # 1 "<command line>" # 1 "test.c" typedef unsigned char uint8_t; __inline__ uint8_t spi_manual_send_ass_GCC_BUGGY( uint8_t dat ) { uint8_t pb; __asm__ volatile ( "\n" "nop \n\t" "ori %a1,8 \n\t" "out 0x05,%a1 \n\t" : "=&d" (dat) : "d" (pb) ); return pb; } int main() { uint8_t dat = 0; uint8_t result = 0; result = spi_manual_send_ass_GCC_BUGGY(dat); return 0; }
Created attachment 12910 [details] Preprocessed source of test.c (test.i)
Subject: Bug 30483 Author: aesok Date: Tue Apr 17 21:08:46 2007 New Revision: 123926 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123926 Log: PR target/30483 * config/avr/avr.c (ptrreg_to_str): Replace gcc_unreachable() with error(). Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr.c
Subject: Bug 30483 Author: aesok Date: Tue Apr 17 21:13:29 2007 New Revision: 123927 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123927 Log: PR target/30483 * config/avr/avr.c (ptrreg_to_str): Replace gcc_unreachable() with error(). Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/config/avr/avr.c
Subject: Bug 30483 Author: aesok Date: Tue Apr 17 21:19:06 2007 New Revision: 123929 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123929 Log: PR target/30483 * config/avr/avr.c (ptrreg_to_str): Replace gcc_unreachable() with error(). Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/config/avr/avr.c
Fixed in 4.1, 4.2 branch, and HEAD.