This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13565] New: Register spill problem in x86_64 compiler
- 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: 5 Jan 2004 01:40:51 -0000
- Subject: [Bug c++/13565] New: Register spill problem in x86_64 compiler
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
ICE (register spill problem) when compiling the following code:
<<<start test.cpp>>>
int x,y;
void WriteMemoryW ( int, short, int );
void opcode_DIV ()
{
WriteMemoryW ( 0, x / y, 0 );
WriteMemoryW ( 0, x % y, 0 );
}
<<<end test.cpp>>>
The following output is generated:
test.cpp: In function `void opcode_DIV()':
test.cpp:9: error: unable to find a register to spill in class `DREG'
test.cpp:9: error: this is the insn:
(insn 11 13 12 0 0x2a9564cba0 (parallel [
(set (reg:SI 0 eax [59])
(div:SI (reg:SI 0 eax [61])
(mem/f:SI (symbol_ref:DI ("y")) [0 y+0 S4 A32])))
(set (reg:SI 2 ecx [60])
(mod:SI (reg:SI 0 eax [61])
(mem/f:SI (symbol_ref:DI ("y")) [0 y+0 S4 A32])))
(clobber (reg:CC 17 flags))
]) 268 {*divmodsi4_cltd} (insn_list 10 (nil))
(expr_list:REG_DEAD (reg:SI 0 eax [61])
(expr_list:REG_UNUSED (reg:SI 2 ecx [60])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))))
test.cpp:9: confused by earlier errors, bailing out
Environment:
System: Linux Marclar 2.6.0 #3 Sat Dec 20 22:16:38 EST 2003 x86_64 5
GNU/Linux
Architecture: x86_64
host: x86_64-pc-linux-gnu
build: x86_64-pc-linux-gnu
target: x86_64-pc-linux-gnu
configured with: /var/tmp/portage/gcc-3.3.2-r4/work/gcc-3.3.2/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/3.3
--includedir=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.3
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.3/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.3/info
--enable-shared --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-system-zlib --enable-languages=c,c++,f77,objc
--enable-threads=posix --enable-long-long --disable-checking
--enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.2/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --enable-multilib
How-To-Repeat:
Using the following command line:
gcc -c -O -fschedule-insns test.cpp
------- Additional Comments From marc at mrousseau dot org 2004-01-05 01:40 -------
Fix:
Removing either the -O or -fschedule-insns arugments will allow the code
to compile.
Observation: changing the 2nd argument to the WriteMemoryW function to
an int rather than short fixes the problem as well.
--
Summary: Register spill problem in x86_64 compiler
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: marc at mrousseau dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-pc-linux-gnu
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13565