Bug 52575 - avr*: error: unable to find a register to spill in class 'POINTER_REGS
Summary: avr*: error: unable to find a register to spill in class 'POINTER_REGS
Status: RESOLVED DUPLICATE of bug 50925
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-13 06:29 UTC by Ralf Corsepius
Modified: 2012-03-15 12:14 UTC (History)
3 users (show)

See Also:
Host:
Target: avr-*
Build:
Known to work: 4.6.3
Known to fail: 4.7.0
Last reconfirmed:


Attachments
*.i of the file triggering the error (14.13 KB, text/plain)
2012-03-13 06:29 UTC, Ralf Corsepius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Corsepius 2012-03-13 06:29:07 UTC
Created attachment 26883 [details]
*.i of the file triggering the error

Bootstrapping gcc-4.7.0-RC-20120203 ICEs for avr-rtems*:

/builddir/build/BUILD/rtems-4.11-avr-rtems4.11-gcc-4.7.0/build/./gcc/xgcc -B/builddir/build/BUILD/rtems-4.11-avr-rtems4.11-gcc-4.7.0/build/./gcc/ -nostdinc -B/builddir/build/BUILD/rtems-4.11-avr--4.7.0/build/avr-rtems4.11/avr25/newlib/ -isystem /builddir/build/BUILD/rtems-4.11-avr-rtems4.11-gcc-4.7.0/build/avr-rtems4.11/avr25/newlib/targ-include -isystem /builddir/build/BUILD/rtems-4.11-avr-rtems4.11-gcc-4.7.0/gcc-4.7.0-RC-20120302/newlib/libc/include -B/opt/rtems-4.11/avr-rtems4.11/bin/ -B/opt/rtems-4.11/avr-rtems4.11/lib/ -isystem /opt/rtems-4.11/avr-rtems4.11/include -isystem /opt/rtems-4.11/avr-rtems4.11/sys-include  -mmcu=avr25 -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.20.0\" -DPACKAGE_STRING=\"newlib\ 1.20.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search -Os -DPREFER_SIZE_OVER_SPEED -mcall-prologues -D_COMPILING_NEWLIB -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -fno-builtin      -g -O2 -c -o lib_a-hash.o `test -f 'hash.c' || echo '../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/'`hash.c -save-temps
../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/hash.c: In function '__expand_table':
../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/hash.c:898:1: error: unable to find a register to spill in class 'POINTER_REGS'
../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/hash.c:898:1: error: this is the insn:
(insn 172 96 173 10 (set (reg:QI 18 r18)
        (mem/c:QI (plus:HI (reg/f:HI 28 r28)
                (const_int 5 [0x5])) [16 S1 A8])) ../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/hash.c:886 18 {movqi_insn}
     (nil))
../../../../../../gcc-4.7.0-RC-20120302/newlib/libc/search/hash.c:898: confused by earlier errors, bailing out

Configuration:
CC='gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=generic'
../gcc-4.7.0-RC-20120302/configure --prefix=/opt/rtems-4.11
--bindir=/opt/rtems-4.11/bin --exec_prefix=/opt/rtems-4.11
--includedir=/opt/rtems-4.11/include --libdir=/opt/rtems-4.11/lib
--libexecdir=/opt/rtems-4.11/libexec --mandir=/opt/rtems-4.11/share/man
--infodir=/opt/rtems-4.11/share/info --datadir=/opt/rtems-4.11/share
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=avr-rtems4.11  --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld
--verbose --with-newlib --with-system-zlib --disable-nls
--without-included-gettext --disable-win32-registry
--enable-version-specific-runtime-libs --enable-threads --disable-lto
--disable-plugin --enable-newlib-io-c99-formats --enable-newlib-iconv
--enable-languages=c
Comment 1 Ralf Corsepius 2012-03-13 08:11:56 UTC
FWIW: As things currently appear, this breakdown is not restricted to the -mmcu=avr25 multilib-variant, but affects all RTEMS multilibs.
Comment 2 Georg-Johann Lay 2012-03-13 09:44:04 UTC
There are already spill fails reported for AVR, it's a known problem.

At this point it cannot be said if this PR is really the same as PR50925, but it's not unlikely.

Thus, marking as duplicate resp. yet another testcase for a potential fix of PR50925.

*** This bug has been marked as a duplicate of bug 50925 ***
Comment 3 Ralf Corsepius 2012-03-13 14:08:21 UTC
(In reply to comment #2)
> There are already spill fails reported for AVR, it's a known problem.
> 
> At this point it cannot be said if this PR is really the same as PR50925, but
> it's not unlikely.

I am confused: 

PR50925 says "fails to build 4.6.2", however avr-rtems-gcc4.6.2 and 4.6.3 are known to build, c.f. 
(4.6.2-based rpms) ftp://ftp.rtems.org/pub/rtems/linux/obsolete/4.11/fedora/16/
and
(4.6.3-based rpms) ftp://ftp.rtems.org/pub/rtems/linux/4.11/fedora/16

... but 4.7.0 does not BUILD at all!
=> Regression
Comment 4 Georg-Johann Lay 2012-03-15 12:14:56 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > There are already spill fails reported for AVR, it's a known problem.
> > 
> > At this point it cannot be said if this PR is really the same as PR50925,
> > but it's not unlikely.
> 
> I am confused: 
> 
> PR50925 says "fails to build 4.6.2", however avr-rtems-gcc4.6.2 and 4.6.3 are
> known to build,

These spill fails might come or go with slight variations in surrounding code, compiler source (i.e. version) or change of compiler options. The absence of a spill fail does not mean that it is not present in the compiler, it just means it does not show with that specific test case and set of options.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50925#c19
test case breaks 4.5, 4.6, 4.7 and 4.8 for example.

PR42204 indicates that the problem occurs with framepointer needed/framepointer not needed transitions and changing back and forth. Such transitions depend on the surrounding code and compiler optimizations, of course.

PR52148 is a bit different: The root cause is the same. But a code cleanup made the test case pass. Therefore it's not marked as a duplicate, even though it's very likely that its root cause is also the same as in PR50925. However, the code cleanup along with PR52148 does not fix the root cause; it's just a cleanup that's nice in itself.