This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/19051] New: m6811-elf-gcc ICE
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2004 08:34:41 -0000
- Subject: [Bug target/19051] New: m6811-elf-gcc ICE
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc ICE when I did:
===================
$ m6811-elf-g++ -Os -mshort -msoft-reg-count=32 -m68hc12 -c n.cpp
The ICE message is:
===================
n.cpp: In function 'void getNewTableEntry()':
n.cpp:49: error: unable to find a register to spill in class 'D_REGS'
n.cpp:49: error: this is the insn:
(insn:HI 60 59 62 9 (set (reg:HI 59 [ D.1552 ])
(mult:HI (sign_extend:HI (reg:QI 63))
(sign_extend:HI (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55])))) 70 {mulqihi3} (insn_list:REG_DEP_TRUE 59 (nil))
(expr_list:REG_DEAD (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55])
(expr_list:REG_DEAD (reg:QI 63)
(expr_list:REG_EQUAL (mult:HI (sign_extend:HI (reg/v:QI 14 *_.d1 [orig:55 newIdx ] [55]))
(const_int 6 [0x6]))
(nil)))))
n.cpp:49: internal compiler error: in spill_failure, at reload1.c:1873
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
The m6811-elf-g++ 3.4.4 also generates same ICE.
$ ./m6811-elf-g++ --version
m6811-elf-g++ (GCC) 3.4.4 20041108 (prerelease)
Environment:
System: Linux namsh 2.6.10-rc3n2 #6 Tue Dec 14 15:50:33 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 --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 --disable-nls --disable-threads
How-To-Repeat:
Compile the code below with compiler option I described:
// n.cpp
extern signed char g_oldVal, g_newVal;
extern signed char g_base;
extern unsigned char tableA[], tableB[];
extern unsigned char g_AAval, g_APval;
extern unsigned char g_BAval, g_BPval;
extern unsigned int g_ARval, g_ABval;
extern unsigned int g_BRval, g_BBval;
typedef struct {
unsigned int r;
unsigned int b;
unsigned char a;
unsigned char p;
} TABLEENTRY;
void getNewTableEntry()
{
signed char oldIdx = g_oldVal, newIdx = g_newVal;
const signed char maxVal = ((44 * 2) + 6 * 2);
oldIdx += g_base;
newIdx += g_base;
if (oldIdx < 0)
oldIdx = 0;
else if (oldIdx > maxVal)
oldIdx = maxVal;
if (newIdx < 0)
newIdx = 0;
else if (newIdx > maxVal)
newIdx = maxVal;
if (oldIdx != newIdx)
{
TABLEENTRY *tablePtr;
tablePtr = (TABLEENTRY *) tableA + newIdx;
g_ARval = tablePtr->r;
g_ABval = tablePtr->b;
g_AAval = tablePtr->a;
g_APval = tablePtr->p;
tablePtr = (TABLEENTRY *) tableB + newIdx;
g_BRval = tablePtr->r;
g_BBval = tablePtr->b;
g_BAval = tablePtr->a;
g_BPval = tablePtr->p;
}
}
------- Additional Comments From namsh at kldp dot org 2004-12-17 08:34 -------
Fix:
The work-around is:
1. Remove one of the compiler options: -Os or -msoft-reg-count=32
2. Use 'int' instead of 'signed char' for oldIdx/newIdx.
--
Summary: m6811-elf-gcc ICE
Product: gcc
Version: 0.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: namsh at kldp dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: m6811-unknown-none
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19051