------- Comment #8 from hjl dot tools at gmail dot com  2009-02-09 20:29 -------
[...@gnu-6 reg-1]$ cat b.c
extern void abort (void);
int g = 3;

int main()
{
    register int x __asm__("ecx");
    x = 5;
    if ((1 << g) != 8 || x != 5)
      abort ();
    return 0;
}
[...@gnu-6 reg-1]$ /export/build/gnu/gcc-work/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-work/build-x86_64-linux/gcc/ -m32 -O0  b.c -S -o b.s
b.c: In function ‘main’:
b.c:11: error: unable to find a register to spill in class ‘CREG’
b.c:11: error: this is the insn:
(insn 8 7 9 2 b.c:8 (parallel [
            (set (reg:SI 0 ax [orig:60 D.1254 ] [60])
                (ashift:SI (reg:SI 1 dx [63])
                    (subreg:QI (reg:SI 0 ax [orig:61 g.0 ] [61]) 0)))
            (clobber (reg:CC 17 flags))
        ]) 495 {*ashlsi3_1} (expr_list:REG_DEAD (reg:SI 1 dx [63])
        (expr_list:REG_DEAD (reg:SI 0 ax [orig:61 g.0 ] [61])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
b.c:11: internal compiler error: in spill_failure, at reload1.c:2093
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[...@gnu-6 reg-1]$ 

My point is if you use "register unsigned long reg asm" on local
variables, you may run into ICE or unexpected results if the
register you specified happens to be used by compiler for
some basic operations.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39139

Reply via email to