Here is is ICE message: $ m6811-elf-gcc -c -m68hc12 -O3 -fomit-frame-pointer strcat.c strcat.c: In function `strcat': strcat.c:18: internal compiler error: in verify_local_live_at_start, at flow.c:546 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. Environment: System: Linux namsh 2.6.4 #66 Thu Mar 11 22:55:35 KST 2004 i686 athlon i386 GNU/Linux Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: m6811-unknown-none configured with: ../configure --disable-nls --target=m6811-elf --prefix=/usr/GNUHCS --program-prefix=m6811-elf- --with-gnu-ld --with-gnu-as --disable-shared --enable-languages=c,c++ --without-headers --with-newlib How-To-Repeat: Here is a source: /* strcat.c */ char *strcat(char *d, const char *s) { char *p = d; while (*d) d++; while ((*d = *s) != '\0') { d++; s++; } return p; }
Fix: 1. Do not use '-fomit-frame-pointer' 2. Use '-O2' instead of '-O3'.
/* After reload, there are no pseudos, nor subregs of multi-word registers. The regsets should exactly match. */
Confirmed. live_at_start mismatch in bb 0, aborting New: first = 0x42020db0 current = 0x42020db0 indx = 0 0x42020db0 next = 0x0 prev = 0x0 indx = 0 bits = { 1 3 } Old: ;; basic block 0, loop depth 0, count 0 ;; prev block -1, next block 1 ;; pred: ENTRY [100.0%] (fallthru) ;; succ: 1 [100.0%] (fallthru) ;; Registers live at start: 0 [x] 1 [d] 3 [sp] (note:HI 61 2 126 0 [bb 0] NOTE_INSN_BASIC_BLOCK) (note 126 61 5 0 NOTE_INSN_PROLOGUE_END) (note:HI 5 126 143 0 NOTE_INSN_FUNCTION_BEG) (insn 143 5 144 0 (set (mem:HI (pre_dec:HI (reg/f:HI 3 sp)) [0 S2 A8]) (reg:HI 1 d [ d ])) 26 {*movhi_68hc12} (nil) (nil)) (insn 144 143 133 0 (set (reg:HI 0 x) (reg:HI 1 d [ d ])) 26 {*movhi_68hc12} (nil) (expr_list:REG_DEAD (reg:HI 1 d [ d ]) (nil))) ;; Registers live at end: 0 [x] 3 [sp]
I suspect this is related to the -fweb that was activated when -O3 (disabled completely in m6811 in 3.4). Going to check.
Subject: Bug 14542 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: ciceron@gcc.gnu.org 2004-06-06 16:56:04 Modified files: gcc : ChangeLog gcc/config/m68hc11: m68hc11.md Log message: PR target/14542 * config/m68hc11/m68hc11.md (move peephole2): Emit a use note to avoid a live change of a register after peephole replacement. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.469&r2=2.2326.2.470 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68hc11/m68hc11.md.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.54.10.6&r2=1.54.10.7
Subject: Bug 14542 CVSROOT: /cvs/gcc Module name: gcc Changes by: ciceron@gcc.gnu.org 2004-06-06 17:01:10 Modified files: gcc : ChangeLog gcc/config/m68hc11: m68hc11.md Log message: PR target/14542 * config/m68hc11/m68hc11.md (move peephole2): Emit a use note to avoid a live change of a register after peephole replacement. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3854&r2=2.3855 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68hc11/m68hc11.md.diff?cvsroot=gcc&r1=1.65&r2=1.66
Fixed by http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00294.html