Skip to contentSkip to conversation

Error during compilation

Qemu-devel Peter Federighi 5 participants 5 messages Mar 15, 2005

lore
Share & tools
lore
#0 lore raw

Hello.

I recently downloaded Qemu to try it out. My attempt to compile it ended up producing the following error:

--- BEGIN OUTPUT ---

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I. -I/usr/src/qemu-0.6.1/target-i386 -I/usr/src/qemu-0.6.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/usr/src/qemu-0.6.1/slirp -c -o helper.o /usr/src/qemu-0.6.1/target-i386/helper.c /usr/src/qemu-0.6.1/softmmu_template.h: In function `__stq_mmu':
/usr/src/qemu-0.6.1/softmmu_template.h:223: error: unable to find a register to spill in class `GENERAL_REGS' /usr/src/qemu-0.6.1/softmmu_template.h:223: error: this is the insn:
(insn:HI 315 314 316 13 /usr/src/qemu-0.6.1/softmmu_template.h:252 (parallel [

            (set (reg:DI 0 ax [194])
                (lshiftrt:DI (reg/v:DI 59 [ val ])
                    (subreg:QI (reg:SI 0 ax [193]) 0)))
            (clobber (scratch:SI))
            (clobber (reg:CC 17 flags))
        ]) 306 {lshrdi3_1} (insn_list 314 (nil))
    (expr_list:REG_DEAD (reg:SI 0 ax [193])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (expr_list:REG_UNUSED (scratch:SI)
                (nil)))))

/usr/src/qemu-0.6.1/softmmu_template.h:223: confused by earlier errors, bailing out
make[1]: *** [helper.o] Error 1
make[1]: Leaving directory `/usr/src/qemu-0.6.1/i386'
make: *** [all] Error 1

--- END OUTPUT ---

Normally, I would include a solution to the error, but I have never seen an error like this and don't really know what to do. I get the same problem when trying to compile the latest snapshot as well. I hope that this information is useful.

In case it matters, I have the following versions of software:
Linux 2.6.10
GCC 3.4.3
BinUtils 2.13.1
GLibc 2.3.2
GNU Make 3.80

Thank you for your time and effort on Qemu.

- Peter Federighi

The fear of the Lord is the beginning of wisdom,
and knowledge of the Holy One is understanding.
- Proverbs 9:10

__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

#2 lore raw
Quoted 1 line · John R. Hogerhuis

Huh... never seen gcc barf in lisp!

RTL (back end CPU language) is basically a form of lisp.

DF

#3 lore raw
In reply to Peter Federighi
Quoted 20 lines · Peter Federighi

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I.

(quoted diff) +0 -3
-I/usr/src/qemu-0.6.1/target-i386 -I/usr/src/qemu-0.6.1 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/usr/src/qemu-0.6.1/slirp -c
-o helper.o /usr/src/qemu-0.6.1/target-i386/helper.c

/usr/src/qemu-0.6.1/softmmu_template.h: In function `__stq_mmu':
/usr/src/qemu-0.6.1/softmmu_template.h:223: error: unable to find a register to spill in class `GENERAL_REGS' /usr/src/qemu-0.6.1/softmmu_template.h:223: error: this is the insn:
(insn:HI 315 314 316 13 /usr/src/qemu-0.6.1/softmmu_template.h:252 (parallel [

            (set (reg:DI 0 ax [194])
                (lshiftrt:DI (reg/v:DI 59 [ val ])
                    (subreg:QI (reg:SI 0 ax [193]) 0)))
            (clobber (scratch:SI))
            (clobber (reg:CC 17 flags))
        ]) 306 {lshrdi3_1} (insn_list 314 (nil))
    (expr_list:REG_DEAD (reg:SI 0 ax [193])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (expr_list:REG_UNUSED (scratch:SI)
                (nil)))))
Quoted 5 lines

/usr/src/qemu-0.6.1/softmmu_template.h:223: confused by earlier errors, bailing out
make[1]: *** [helper.o] Error 1
make[1]: Leaving directory `/usr/src/qemu-0.6.1/i386'
make: *** [all] Error 1

I'm getting the same error when having '-march=athlon-xp' in my $CFLAGS (and forcing qemu to use those). Replacing that with '-march=pentium' fixes the issue for me.

Perhaps someone (e.g. you :-) should report it on one of GCC's mailing lists or through bugzilla (and reduce the code to only contain the relevant parts before doing so).

Regards,
Thomas

#4 lore raw
Quoted 26 lines · Thomas Schwinge
Quoted 23 lines · Peter Federighi

gcc -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I.

(quoted diff) +0 -3
-I/usr/src/qemu-0.6.1/target-i386 -I/usr/src/qemu-0.6.1 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/usr/src/qemu-0.6.1/slirp -c
-o helper.o /usr/src/qemu-0.6.1/target-i386/helper.c

/usr/src/qemu-0.6.1/softmmu_template.h: In function `__stq_mmu':
/usr/src/qemu-0.6.1/softmmu_template.h:223: error: unable to find a register to spill in class `GENERAL_REGS' /usr/src/qemu-0.6.1/softmmu_template.h:223: error: this is the insn:
(insn:HI 315 314 316 13 /usr/src/qemu-0.6.1/softmmu_template.h:252 (parallel [

           (set (reg:DI 0 ax [194])
               (lshiftrt:DI (reg/v:DI 59 [ val ])
                   (subreg:QI (reg:SI 0 ax [193]) 0)))
           (clobber (scratch:SI))
           (clobber (reg:CC 17 flags))
       ]) 306 {lshrdi3_1} (insn_list 314 (nil))

(expr_list:REG_DEAD (reg:SI 0 ax [193])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_UNUSED (scratch:SI)
(nil)))))
/usr/src/qemu-0.6.1/softmmu_template.h:223: confused by earlier errors, bailing out
make[1]: *** [helper.o] Error 1

Quoted 9 lines
Quoted 4 lines

make[1]: Leaving directory `/usr/src/qemu-0.6.1/i386'
make: *** [all] Error 1

I'm getting the same error when having '-march=athlon-xp' in my $CFLAGS (and forcing qemu to use those). Replacing that with '-march=pentium' fixes the issue for me.

I got the same error compiling QEMU with -march=pentium3, but only on op.c and helper.c. All other files compiled fine with that option. Those two files compiled fine with -march=pentium.

Is it a bug? I idly speculated that the register selection method might be different for different archs and that, because these files might demand certain registers be used for certain purposes, the compiler might simple be "unable to find a register" for its needs.

Struan