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)
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.
Reduced testcase: /* gcc -fschedule-insns */ int foo(int a, int b) { return bar(foobar(b) / foobar(a)); }
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.
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 ***