Bug 37659 - unable to find a register to spill in class ‘AREG’
Summary: unable to find a register to spill in class ‘AREG’
Status: RESOLVED DUPLICATE of bug 27001
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-27 16:26 UTC by Török Edwin
Modified: 2008-09-28 19:33 UTC (History)
2 users (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
file dumped by gcc (12.33 KB, text/plain)
2008-09-27 16:28 UTC, Török Edwin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Török Edwin 2008-09-27 16:26:56 UTC
While reducing the testcase for PR37658 I found another bug:

$ gcc-4.3 -fschedule-insns testcase.i
...
testcase.i:193: error: unable to find a register to spill in class ‘AREG’
testcase.i:193: error: this is the insn:
(insn 17782 17785 17783 1528 testcase.i:189 (parallel [
            (set (reg:SI 1 dx [9986])
                (div:SI (reg:SI 3 bx [orig:524 D.8216 ] [524])
                    (reg:SI 1 dx [orig:522 D.8218 ] [522])))
            (set (reg:SI 9987)
                (mod:SI (reg:SI 3 bx [orig:524 D.8216 ] [524])
                    (reg:SI 1 dx [orig:522 D.8218 ] [522])))
            (clobber (reg:CC 17 flags))
        ]) 318 {*divmodsi4_nocltd} (expr_list:REG_DEAD (reg:SI 3 bx [orig:524 D.8216 ] [524])
        (expr_list:REG_DEAD (reg:SI 1 dx [orig:522 D.8218 ] [522])
            (expr_list:REG_UNUSED (reg:SI 9987)
                (expr_list:REG_UNUSED (reg:CC 17 flags)
                    (nil))))))
testcase.i:193: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccA3kPTQ.out file, please attach this to your bugreport.

This happens with all gcc versions I have here (with slightly different error message):
$ gcc-4.3 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1)

$ gcc-4.2 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Debian 4.2.4-3)

$ gcc-4.1 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23)
Comment 1 Török Edwin 2008-09-27 16:28:02 UTC
Created attachment 16416 [details]
file dumped by gcc

This is the file dumped by gcc, I am trying to get a reduced testcase using delta, will attach here when I have it.
Comment 2 Török Edwin 2008-09-27 16:40:48 UTC
Reduced testcase:

/* gcc -fschedule-insns */
int foo(int a, int b) {
        return bar(foobar(b) / foobar(a));
}
Comment 3 Török Edwin 2008-09-27 16:43:18 UTC
the error message for the above testcase:
$ gcc-4.3 -fschedule-insns v.i
v.i: In function ‘foo’:
v.i:3: error: unable to find a register to spill in class ‘AREG’
v.i:3: error: this is the insn:
(insn 17 20 18 2 v.i:2 (parallel [
            (set (reg:SI 1 dx [66])
                (div:SI (reg:SI 3 bx [orig:61 D.1552 ] [61])
                    (reg:SI 1 dx [orig:60 D.1553 ] [60])))
            (set (reg:SI 67)
                (mod:SI (reg:SI 3 bx [orig:61 D.1552 ] [61])
                    (reg:SI 1 dx [orig:60 D.1553 ] [60])))
            (clobber (reg:CC 17 flags))
        ]) 318 {*divmodsi4_nocltd} (expr_list:REG_DEAD (reg:SI 3 bx [orig:61 D.1552 ] [61])
        (expr_list:REG_DEAD (reg:SI 1 dx [orig:60 D.1553 ] [60])
            (expr_list:REG_UNUSED (reg:SI 67)
                (expr_list:REG_UNUSED (reg:CC 17 flags)
                    (nil))))))
v.i:3: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccYIfwlr.out file, please attach this to your bugreport.
Comment 4 Andrew Pinski 2008-09-28 19:33:06 UTC
This is a normal RA issue with targets like x86 where the RA does not understand how to move instructions around to get back the register ...

*** This bug has been marked as a duplicate of 27001 ***