Hello, I tried to compile the newlib with -O1. I got m68k-elf-gcc -B/home/bwalle/src/packages/BUILD/newlib-1.12.0/m68k-elf/m5307/newlib/ -isystem /home/bwalle/src/packages/BUILD/newlib-1.12.0/m68k-elf/m5307/newlib/targ-include -isystem /home/bwalle/src/packages/BUILD/newlib-1.12.0/newlib/libc/include -m5307 -DPACKAGE=\"newlib\" -DVERSION=\"1.12.0\" -I. -I../../../../.././newlib/libc/locale -O2 -DCOMPACT_CTYPE -DMISSING_SYSCALL_NAMES -fno-builtin -O2 -O1 -O2 -O1 -m5307 -c ../../../../.././newlib/libc/locale/fix_grouping.c ../../../../.././newlib/libc/locale/fix_grouping.c: In function `__fix_locale_grouping_str': ../../../../.././newlib/libc/locale/fix_grouping.c:82: Fehler: Befehl erfüllt nicht seine Bedingungen: (insn 217 106 107 12 (set (reg:QI 13 %a5) (mem:QI (reg/v/f:SI 9 %a1 [orig:32 src ] [32]) [0 S1 A8])) 33 {*m68k.md:826} (nil) (nil)) ../../../../.././newlib/libc/locale/fix_grouping.c:82: interner Compiler-Fehler: in reload_cse_simplify_operands, bei postreload.c:391 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. It's newlib 1.12.0, so you should have the source. There are no errors with default -O2 or -O0.
Can you attach the preprocessed source? Read http://gcc.gnu.org/bugs.html for more information on how to do this.
Created attachment 7526 [details] Preprocessed file which causes the error. Here it is.
Closing as invalid to ...
Reopen it.
What does this mean? You cannot reproduce this? I configured gcc 3.4.3 with ./configure \ --prefix=%{prefix} \ --target=m68k-elf \ --program-prefix=m68k-elf- \ --mandir=%{prefix}/share/man \ --infodir=%{prefix}/share/info \ --enable-languages=c \ --with-gnu-as \ --with-gnu-ld \ --disable-shared
No just bugzilla has no way to go from waiting to unconfirmed, I just have not have time to try to reproduce and reduce it yet. Maybe someone else will.
// small testcase, use -O1 -m5200: extern char n; void foo (char *s) { n += *s + 9; }
I get an ICE at exactly the same place when trying to bootstrap current HEAD: xgcc --version Using built-in specs. Configured with: ../gcc/configure --prefix=/usr/local/gcc-head/ --enable-languages=c,java Thread model: posix xgcc (GCC) 4.0.0 20050108 (experimental) The ICE happens when compiling libjava: (...) ../../../gcc/libjava/java/lang/natDouble.cc: In static member function 'static jdouble java::lang::Double::longBitsToDouble(jlong)': ../../../gcc/libjava/java/lang/natDouble.cc:62: error: insn does not satisfy its constraints: (insn 32 30 33 0 ../../../gcc/libjava/java/lang/natDouble.cc:61 (set (mem:DF (plus:SI (reg/f:SI 6 bp) (const_int -24 [0xffffffe8])) [0 S8 A8]) (reg:DF 21 xmm0)) 65 {*movdf_nointeger} (nil) (nil)) ../../../gcc/libjava/java/lang/natDouble.cc:62: internal compiler error: in reload_cse_simplify_operands, at postreload.c:391 Please submit a full bug report. This is on SuSE linux 9.1, Bootstrap compiler is gcc 3.3.3 (as shipped by SuSE), and I use "-g -O2 -march=pentium3" as CFLAGS. (On a Pentium M.) Is this related, or should I open a new bug report?
I can confirm this for m68k-rtems with gcc 4.0.0 20050303. This looks like the ICE that happens for us in our pppd stack on the Coldfire. I also confirm that the small test case in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18421#c7 occurs.
I can reproduce it with gcc-4.0.0 (20050406) Interestingly, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18421#c7 does not ICE with -mO0, -mO2, -mO3!
Created attachment 8577 [details] Patch to prevent bytes from being loaded into address registers The above patch fixes this problem by adding m68k_regno_mode_ok() which rejects bytes in address registers. I also had to modify addsi3_5200 to reject 's' in favor of 'i' due to the 9 being pushed into a register(sice it is a known value, it doesn't match any of the constraints(as in 's') in addsi3_5200). I haven't tried adding a peephole2 as suggested by Ian in: http://gcc.gnu.org/ml/gcc/2004-04/msg01258.html Also there's a ChangeLog entry at the beginning of the patch.
(In reply to comment #11) > Created an attachment (id=8577) > Patch to prevent bytes from being loaded into address registers I can confirm that today's m68k-rtems47-gcc-4.0 with your patch applied does not ICE anymore, neither with the test case form comment #7, nor with rtems pppd code.
The patch in comment #11 is wrong. The condition (!((regno) < 8 && (regno) + GET_MODE_SIZE (mode) / 4 > 8)) is always true when regno >= 8. It needs to be moved up to under the first condition.
A revised patch was posted here: http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00853.html I will attach it here in case someone wants to apply it to an old version of GCC.
Created attachment 9246 [details] Updated patch
Subject: Bug 18421 CVSROOT: /cvs/gcc Module name: gcc Changes by: bernie@gcc.gnu.org 2005-07-11 23:32:01 Modified files: gcc : ChangeLog gcc/config/m68k: m68k.md m68k.c m68k.h m68k-protos.h Log message: PR middle-end/16719 PR middle-end/18421 * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes in address registers. * config/m68k/m68k.c (hard_regno_mode_ok): Likewise. * config/m68k/m68k.md: Replace 's' with 'i' in 4th alternative of addsi3_5200. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9411&r2=2.9412 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.md.diff?cvsroot=gcc&r1=1.84&r2=1.85 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.c.diff?cvsroot=gcc&r1=1.152&r2=1.153 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.h.diff?cvsroot=gcc&r1=1.128&r2=1.129 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k-protos.h.diff?cvsroot=gcc&r1=1.20&r2=1.21
Fixed.
Oops... still pending for 4.0 and 3.4.
Subject: Bug 18421 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: bernie@gcc.gnu.org 2005-07-26 04:40:44 Modified files: gcc : ChangeLog gcc/config/m68k: m68k.md m68k.h m68k.c m68k-protos.h Log message: Backport from mainline: 2005-07-12 Peter Barada <peter@the-baradas.com> PR middle-end/16719 PR middle-end/18421 * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes in address registers. * config/m68k/m68k.c (hard_regno_mode_ok): Likewise. * config/m68k/m68k.md: Replace 's' with 'i' in 4th alternative of addsi3_5200. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.331&r2=2.7592.2.332 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.md.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.80&r2=1.80.34.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.123&r2=1.123.10.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.144&r2=1.144.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k-protos.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.17&r2=1.17.18.1
Subject: Bug 18421 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: bernie@gcc.gnu.org 2005-07-26 20:32:26 Modified files: gcc : ChangeLog gcc/config/m68k: m68k-protos.h m68k.c m68k.h m68k.md Log message: Backport from mainline: 2005-07-12 Peter Barada <peter@the-baradas.com> PR middle-end/16719 PR middle-end/18421 * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes in address registers. * config/m68k/m68k.c (hard_regno_mode_ok): Likewise. * config/m68k/m68k.md: Replace 's' with 'i' in 4th alternative of addsi3_5200. 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.884&r2=2.2326.2.885 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k-protos.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.14.10.1&r2=1.14.10.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.123.2.3&r2=1.123.2.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.103.4.5&r2=1.103.4.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.md.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.71.4.3&r2=1.71.4.4