[ Forwarded from http://bugs.debian.org/375522 ] I get the following ICE with gcc 4.1 and 4.2 on m68k: 928:tbm@reyes: ~] m68k-linux-gnu-gcc -c -O2 mini.c mini.c: In function ‘scan’: mini.c:48: warning: incompatible implicit declaration of built-in function ‘strlen’ mini.c:90: warning: assignment makes integer from pointer without a cast mini.c:94: warning: incompatible implicit declaration of built-in function ‘strlen’ mini.c:115: warning: initialization from incompatible pointer type mini.c:122: error: insn does not satisfy its constraints: (insn 323 57 324 9 (set (reg:QI 8 %a0) (mem/s:QI (plus:SI (reg/f:SI 14 %a6) (const_int -128 [0xffffff80])) [0 name+0 S1 A16])) 41 {*m68k.md:748} (nil) (nil)) mini.c:122: internal compiler error: in reload_cse_simplify_operands, at postreload.c:393 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. zsh: exit 1 m68k-linux-gnu-gcc -c -O2 mini.c 929:tbm@reyes: ~] m68k-linux-gnu-gcc -c -O1 mini.c mini.c: In function ‘scan’: mini.c:48: warning: incompatible implicit declaration of built-in function ‘strlen’ mini.c:90: warning: assignment makes integer from pointer without a cast mini.c:94: warning: incompatible implicit declaration of built-in function ‘strlen’ mini.c:115: warning: initialization from incompatible pointer type 930:tbm@reyes: ~] FWIW, this test case fails with 4.2 but works with 4.1. The original bug was reported against 4.1 though. I can build a 4.1 and run delta again if this would be helpful. The original ICE with 4.1 is: crest% gcc -c -O2 scansbr.i scansbr.c: In function 'scan': scansbr.c:369: error: insn does not satisfy its constraints: (insn 1657 689 1658 81 (set (reg:QI 8 %a0) (mem/s:QI (plus:SI (reg/f:SI 14 %a6) (const_int -212 [0xffffff2c])) [0 name+0 S1 A16])) 33 {*m68k.md:748} (nil) (nil)) scansbr.c:369: internal compiler error: in reload_cse_simplify_operands, at postreload.c:393 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Update: 4.0 shows the same problem. 3.4.6 works crest% gcc-4.0 -c -O2 scansbr.i scansbr.c: In function 'scan': scansbr.c:154: warning: pointer targets in passing argument 2 of 'm_getfld' differ in signedness scansbr.c:154: warning: pointer targets in passing argument 3 of 'm_getfld' differ in signedness scansbr.c:189: warning: pointer targets in passing argument 2 of 'm_getfld' differ in signedness scansbr.c:189: warning: pointer targets in passing argument 3 of 'm_getfld' differ in signedness scansbr.c:225: warning: pointer targets in passing argument 2 of 'm_getfld' differ in signedness scansbr.c:225: warning: pointer targets in passing argument 3 of 'm_getfld' differ in signedness scansbr.c:262: warning: pointer targets in passing argument 2 of 'm_getfld' differ in signedness scansbr.c:262: warning: pointer targets in passing argument 3 of 'm_getfld' differ in signedness scansbr.c:369: error: insn does not satisfy its constraints: (insn 1692 701 1693 82 (set (reg:QI 8 %a0) (mem/s:QI (plus:SI (reg/f:SI 14 %a6) (const_int -212 [0xffffff2c])) [0 name+0 S1 A16])) 33 {*m68k.md:746} (nil) (nil)) scansbr.c:369: internal compiler error: in reload_cse_simplify_operands, at postreload.c:391 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.
Created attachment 11762 [details] test case for 4.2 reduced testcase, shows the problem with 4.2 only
Created attachment 11763 [details] preprocessed source Original preprocessed source, shows the problem with 4.0, 4.1 and 4.2. Works with 3.4.6.
Created attachment 11764 [details] preprocessed source Original preprocessed source, shows the problem with 4.0, 4.1 and 4.2. Works with 3.4.6.
Created attachment 11765 [details] test case This one fails with gcc 4.1 and 4.2.
The bug is much older, I was able to get it fail using the sources at the 3.4 branch point. That 3.4.6 does not fail is probably just coincidence.
m68k is not a primary or secondary platform.
Created attachment 12436 [details] testcase another testcase
Created attachment 12785 [details] Partial patch Please try this patch. It removes the ICE, but the code may not run on 68000 and 68010 CPUs because there is also an alignment problem. Please see <URL:http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00766.html> for details.
Won't fix in GCC-4.0.x. Adjusting milestone.
Subject: Bug 28181 Author: rsandifo Date: Tue Mar 6 09:01:07 2007 New Revision: 122609 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122609 Log: gcc/ PR target/28181 * config/m68k/m68k-protos.h (m68k_secondary_reload_class): Declare. (m68k_preferred_reload_class): Likewise. * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Remove duplicated comment. (SECONDARY_RELOAD_CLASS): Define. (PREFERRED_RELOAD_CLASS): Use m68k_preferred_reload_class. (LIMIT_RELOAD_CLASS): Delete. * config/m68k/m68k.c (m68k_regno_mode_ok): Don't prevent address registers from storing bytes. (m68k_secondary_reload_class): New function. (m68k_preferred_reload_class): Likewise. gcc/testsuite/ * gcc.c-torture/compile/m68k-byte-addr.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/m68k-byte-addr.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/m68k/m68k-protos.h trunk/gcc/config/m68k/m68k.c trunk/gcc/config/m68k/m68k.h trunk/gcc/testsuite/ChangeLog
Now fixed in trunk. The patch may be too invasive to backport; I'm not sure.
Closing 4.1 branch.
Closing 4.2 branch, fixed in 4.3.