public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/31786]  New: error: unable to find a register to spill in class 'BASE_POINTER_REGS'
@ 2007-05-02 13:14 ralf_corsepius at rtems dot org
  2007-05-02 19:34 ` [Bug target/31786] " eweddington at cso dot atmel dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: ralf_corsepius at rtems dot org @ 2007-05-02 13:14 UTC (permalink / raw)
  To: gcc-bugs

bootstrapping avr-rtems* gcc-4.2.0-200704030 fails with:

/builddir/build/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/build/./gcc/xgcc
-B/builddir/build/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/build/./gcc/ -nostdinc
-B/builddir/build/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/build/avr-rtems4.8/newlib/
-isystem
/builddir/build/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/build/avr-rtems4.8/newlib/targ-include
-isystem
/builddir/build/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/gcc-4.2.0-20070430/newlib/libc/include
-B/opt/rtems-4.8/avr-rtems4.8/bin/ -B/opt/rtems-4.8/avr-rtems4.8/lib/ -isystem
/opt/rtems-4.8/avr-rtems4.8/include -isystem
/opt/rtems-4.8/avr-rtems4.8/sys-include -DPACKAGE_NAME=\"newlib\"
-DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.15.0\"
-DPACKAGE_STRING=\"newlib\ 1.15.0\" -DPACKAGE_BUGREPORT=\"\"  -I.
-I../../../../../../gcc-4.2.0-20070430/newlib/libc/misc -Os
-DPREFER_SIZE_OVER_SPEED -mcall-prologues -DMALLOC_PROVIDED -DEXIT_PROVIDED
-DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED
-DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL -fno-builtin      -O2 -g -O2  
-mmcu=avr25 -c -o lib_a-init.o `test -f 'init.c' || echo
'../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/'`init.c
../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/init.c: In function
'__libc_fini_array':
../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/init.c:59: error: unable
to find a register to spill in class 'BASE_POINTER_REGS'
../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/init.c:59: error: this is
the insn:
(insn 84 55 56 4
../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/init.c:56 (set (mem/c:HI
(plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [5 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
../../../../../../gcc-4.2.0-20070430/newlib/libc/misc/init.c:59: confused by
earlier errors, bailing out


-- 
           Summary: error: unable to find a register to spill in class
                    'BASE_POINTER_REGS'
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ralf_corsepius at rtems dot org
GCC target triplet: avr-rtems*


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
@ 2007-05-02 19:34 ` eweddington at cso dot atmel dot com
  2007-05-03  9:27 ` ralf_corsepius at rtems dot org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-05-02 19:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from eweddington at cso dot atmel dot com  2007-05-02 20:34 -------
This must be specific to RTEMS/newlib, as 4.2.0-20070430 (RC2) builds without
error with:

CFLAGS=-D__USE_MINGW_ACCESS  \
../gcc-$version/configure \
    --prefix=$installdir \
    --target=avr \
    --enable-languages=c,c++ \
    --with-dwarf2 \
    --enable-win32-registry=WinAVR-$release \
    --disable-nls \
    --with-gmp=/usr/local \
    --with-mpfr=/usr/local \
    --enable-doc \
    --disable-libssp \
    2>&1 | tee $package-configure.log 

for host=mingw.


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
  2007-05-02 19:34 ` [Bug target/31786] " eweddington at cso dot atmel dot com
@ 2007-05-03  9:27 ` ralf_corsepius at rtems dot org
  2007-05-03  9:43 ` ralf_corsepius at rtems dot org
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ralf_corsepius at rtems dot org @ 2007-05-03  9:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ralf_corsepius at rtems dot org  2007-05-03 10:27 -------
I can also reproduce the bug with 4.2.0-20070501.

It also is related to optimization levels. Newlib is being compiled with -O2,
which triggers this breakdown. Using -O1 or -Os to build init.c lets the
breakdown vanish.

Eric, due to bugzilla's current brokenness, I am sending you the *.i on PM.


-- 

ralf_corsepius at rtems dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.2.0
      Known to work|                            |4.0.3


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
  2007-05-02 19:34 ` [Bug target/31786] " eweddington at cso dot atmel dot com
  2007-05-03  9:27 ` ralf_corsepius at rtems dot org
@ 2007-05-03  9:43 ` ralf_corsepius at rtems dot org
  2007-05-03 12:05 ` eweddington at cso dot atmel dot com
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ralf_corsepius at rtems dot org @ 2007-05-03  9:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ralf_corsepius at rtems dot org  2007-05-03 10:43 -------
Created an attachment (id=13501)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13501&action=view)
*.i of the breakdown above


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (2 preceding siblings ...)
  2007-05-03  9:43 ` ralf_corsepius at rtems dot org
@ 2007-05-03 12:05 ` eweddington at cso dot atmel dot com
  2007-05-03 12:12 ` ralf dot corsepius at rtems dot org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-05-03 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from eweddington at cso dot atmel dot com  2007-05-03 13:05 -------
Subject: RE:  error: unable to find a register to spill in
 class 'BASE_POINTER_REGS'



> ------- Comment #2 from ralf_corsepius at rtems dot org  
> 2007-05-03 10:27 -------
> I can also reproduce the bug with 4.2.0-20070501.
> 
> It also is related to optimization levels. Newlib is being 
> compiled with -O2,
> which triggers this breakdown. Using -O1 or -Os to build 
> init.c lets the
> breakdown vanish.
> 
> Eric, due to bugzilla's current brokenness, I am sending you 
> the *.i on PM.

Hi Ralf,
All public distros use avr-libc instead of newlib to build an AVR toolchain:
<http://savannah.nongnu.org/projects/avr-libc>
AFAIK, it is only RTEMS that attempts to use newlib. And because of this the
only testing that is done is when you do it, so I'm not surprised that
newlib is broken for the avr.

Eric


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (3 preceding siblings ...)
  2007-05-03 12:05 ` eweddington at cso dot atmel dot com
@ 2007-05-03 12:12 ` ralf dot corsepius at rtems dot org
  2007-05-03 13:07 ` ralf_corsepius at rtems dot org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ralf dot corsepius at rtems dot org @ 2007-05-03 12:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ralf dot corsepius at rtems dot org  2007-05-03 13:12 -------
Subject: RE:  error: unable to find a register to spill
        in class 'BASE_POINTER_REGS'

On Thu, 2007-05-03 at 06:05 -0600, Eric Weddington wrote:
>  
> > ------- Comment #2 from ralf_corsepius at rtems dot org  
> > 2007-05-03 10:27 -------
> > I can also reproduce the bug with 4.2.0-20070501.
> > 
> > It also is related to optimization levels. Newlib is being 
> > compiled with -O2,
> > which triggers this breakdown. Using -O1 or -Os to build 
> > init.c lets the
> > breakdown vanish.
> > 
> > Eric, due to bugzilla's current brokenness, I am sending you 
> > the *.i on PM.
> 
> Hi Ralf,
> All public distros use avr-libc instead of newlib to build an AVR toolchain:
> <http://savannah.nongnu.org/projects/avr-libc>
> AFAIK, it is only RTEMS that attempts to use newlib. And because of this the
> only testing that is done is when you do it, so I'm not surprised that
> newlib is broken for the avr.
Though what you say is true, the file avr bombs out on is mere "c", i.e.
a bug in GCC.

Ralf


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (4 preceding siblings ...)
  2007-05-03 12:12 ` ralf dot corsepius at rtems dot org
@ 2007-05-03 13:07 ` ralf_corsepius at rtems dot org
  2007-05-03 14:21 ` ralf_corsepius at rtems dot org
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ralf_corsepius at rtems dot org @ 2007-05-03 13:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ralf_corsepius at rtems dot org  2007-05-03 14:07 -------
This is the minimised *.c having been extracted from newlib's file exposing the
bug:
-- snip --
extern void (*array_start []) (void);
extern void (*array_end []) (void);

void
init_array (void)
{
  int count;
  int i;
  count = array_end - array_start;
  for (i = 0; i < count; i++)
    array_start[i] ();
}
-- snip --

Pretty trivial code, isn't it?


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (5 preceding siblings ...)
  2007-05-03 13:07 ` ralf_corsepius at rtems dot org
@ 2007-05-03 14:21 ` ralf_corsepius at rtems dot org
  2007-05-03 15:40 ` eweddington at cso dot atmel dot com
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ralf_corsepius at rtems dot org @ 2007-05-03 14:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ralf_corsepius at rtems dot org  2007-05-03 15:20 -------
FYI: Vanilla gcc-4.1.2 without newlib also exposes this issue with the code
fragment from comment #6:

./avr-gcc -o tmp.o -c init.c -O2
init.c: In function 'init_array':
init.c:12: error: unable to find a register to spill in class
'BASE_POINTER_REGS'
init.c:12: error: this is the insn:
(insn 61 30 31 2 (set (mem/c:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [4 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
init.c:12: confused by earlier errors, bailing out


-- 

ralf_corsepius at rtems dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.2.0                       |4.1.2 4.2.0


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (6 preceding siblings ...)
  2007-05-03 14:21 ` ralf_corsepius at rtems dot org
@ 2007-05-03 15:40 ` eweddington at cso dot atmel dot com
  2007-05-04 15:06 ` eweddington at cso dot atmel dot com
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-05-03 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from eweddington at cso dot atmel dot com  2007-05-03 16:40 -------
Confirmed. Code snippet fails for 4.1.2 when compiling for -O2 and -O3. Note
that compiling with -O[0,1,s] is successful.

Changing target to all avr.


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|avr-rtems*                  |avr-*-*
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-03 16:40:04
               date|                            |


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (7 preceding siblings ...)
  2007-05-03 15:40 ` eweddington at cso dot atmel dot com
@ 2007-05-04 15:06 ` eweddington at cso dot atmel dot com
  2007-05-30 20:40 ` [Bug target/31786] [4.1/4.2/4.3 Regression][avr] " eweddington at cso dot atmel dot com
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-05-04 15:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from eweddington at cso dot atmel dot com  2007-05-04 16:06 -------
>From Bjoern Haase:

Hi all,

I think that we could resolve this ICE by adding an unnamed pattern like

(define_insn "*strangeMovhi"
  [(set (mem:HI (plus:HI (reg:HI 28)
                         (const_int 1)))
        (match_operand:HI 0 "general_operand" "r"))]
  ""
  "st %A0,y+1 \n\t st %B0,y+2"
  [(set_attr "length" "2")])


to the machine description "avr.md" . That might cure the symptoms and does not
resolve the underlying problem with reload, but this might be a fix for the
immediate issue.

Note that above remark is untested pseudo-code.

Yours,

Bjoern.

P.S.: Eric, you might add this remark to the bugzilla entry.


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (8 preceding siblings ...)
  2007-05-04 15:06 ` eweddington at cso dot atmel dot com
@ 2007-05-30 20:40 ` eweddington at cso dot atmel dot com
  2007-06-10 16:43 ` eweddington at cso dot atmel dot com
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-05-30 20:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from eweddington at cso dot atmel dot com  2007-05-30 20:40 -------
Fails for 4.3-20070525


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-05-03 16:40:04         |2007-05-30 20:40:03
               date|                            |
            Summary|error: unable to find a     |[4.1/4.2/4.3
                   |register to spill in class  |Regression][avr] error:
                   |'BASE_POINTER_REGS'         |unable to find a register to
                   |                            |spill in class
                   |                            |'BASE_POINTER_REGS'
   Target Milestone|---                         |4.2.1


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (9 preceding siblings ...)
  2007-05-30 20:40 ` [Bug target/31786] [4.1/4.2/4.3 Regression][avr] " eweddington at cso dot atmel dot com
@ 2007-06-10 16:43 ` eweddington at cso dot atmel dot com
  2007-06-10 16:50 ` eweddington at cso dot atmel dot com
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-10 16:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from eweddington at cso dot atmel dot com  2007-06-10 16:43 -------
*** Bug 24894 has been marked as a duplicate of this bug. ***


-- 

eweddington at cso dot atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joel at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (10 preceding siblings ...)
  2007-06-10 16:43 ` eweddington at cso dot atmel dot com
@ 2007-06-10 16:50 ` eweddington at cso dot atmel dot com
  2007-07-04  3:06 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-06-10 16:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from eweddington at cso dot atmel dot com  2007-06-10 16:50 -------
According to a comment in duplicate bug #24894, bug #19636 may be related.

Ralf, can you try the test case using a 4.3 snapshot?


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (11 preceding siblings ...)
  2007-06-10 16:50 ` eweddington at cso dot atmel dot com
@ 2007-07-04  3:06 ` mmitchel at gcc dot gnu dot org
  2008-01-02 13:44 ` hutchinsonandy at netscape dot net
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-07-04  3:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (12 preceding siblings ...)
  2007-07-04  3:06 ` mmitchel at gcc dot gnu dot org
@ 2008-01-02 13:44 ` hutchinsonandy at netscape dot net
  2008-01-02 23:46 ` hutchinsonandy at netscape dot net
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hutchinsonandy at netscape dot net @ 2008-01-02 13:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from hutchinsonandy at netscape dot net  2008-01-02 13:36 -------
Problem occurs because 1 base pointer is used for function pointer and the
other is used for frame pointer. (There are only 2). Backend
LEGITIMIZE_RELOAD_ADDRESS tells reload to use a base pointer for reload pass of
mem(SP+1). This fails.
Unfortunately reload does not figure out that it can use frame pointer and
gives ICE. (Ironically the frame pointer would be eliminated in this testcase
latter)

The problem potentially occurs whenever R30,R31 is tied up. (EEPROM macros are
other example)

Reload calls LEGITIMIZE_RELOAD_ADDRESS when strict address check fails
legitimate_address_p on SP+1 - since AVR has no way of indexing from stack
pointer.

Potential fix is to stop LEGITIMIZE_RELOAD_ADDRESS from telling reload
(push_reload)  to use BASE_POINTER class. POINTER CLASS is one wider and target
macros have pattern to use register 'REG_X' as index (with addition).
Alternatively don't suggest any substitution (ie not GOTO WIN) and reload finds
answer.

The latter solution has been tested and caused ICE in GCC library building as
'REG_X' is not allowable with strict address checking (legitimate_address_p ) -
so we get no pattern match ICE for MOVQI (REG_X+1),Rxx. However, backend does
contain such patterns. Changing legitimate_address_p to accept REG_X solves
problem.
In the testcase, the instruction that caused the ICE is eliminated - so the
newly allowable pattern is never used.

The build ICE caused by first change does indicate that on occasion GCC will
really use REG_X as index. Potentially producing sub-optimal code compared with
REG_Y or REG_Z. However, the incidence is clearly low and may well be offset by
other side effect improvements.


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (13 preceding siblings ...)
  2008-01-02 13:44 ` hutchinsonandy at netscape dot net
@ 2008-01-02 23:46 ` hutchinsonandy at netscape dot net
  2008-01-13 16:04 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hutchinsonandy at netscape dot net @ 2008-01-02 23:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hutchinsonandy at netscape dot net  2008-01-02 23:29 -------
Created an attachment (id=14862)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14862&action=view)
Patch to current HEAD 

This will patch avr.h and avr.c to allow REG_X as valid BASE_POINTER.


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.1/4.2/4.3 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (14 preceding siblings ...)
  2008-01-02 23:46 ` hutchinsonandy at netscape dot net
@ 2008-01-13 16:04 ` rguenth at gcc dot gnu dot org
  2008-07-04 22:03 ` [Bug target/31786] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-13 16:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2008-01-13 15:44 -------
Adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.2.1                       |4.1.3


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.2/4.3/4.4 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (15 preceding siblings ...)
  2008-01-13 16:04 ` rguenth at gcc dot gnu dot org
@ 2008-07-04 22:03 ` jsm28 at gcc dot gnu dot org
  2008-09-14 12:53 ` aesok at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jsm28 at gcc dot gnu dot org  2008-07-04 22:02 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3/4.4            |[4.2/4.3/4.4
                   |Regression][avr] error:     |Regression][avr] error:
                   |unable to find a register to|unable to find a register to
                   |spill in class              |spill in class
                   |'BASE_POINTER_REGS'         |'BASE_POINTER_REGS'
   Target Milestone|4.1.3                       |4.2.5


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.2/4.3/4.4 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (16 preceding siblings ...)
  2008-07-04 22:03 ` [Bug target/31786] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2008-09-14 12:53 ` aesok at gcc dot gnu dot org
  2009-03-31 20:09 ` [Bug target/31786] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: aesok at gcc dot gnu dot org @ 2008-09-14 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from aesok at gcc dot gnu dot org  2008-09-14 12:51 -------
Subject: Bug 31786

Author: aesok
Date: Sun Sep 14 12:50:10 2008
New Revision: 140360

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140360
Log:
        PR target/19636
        PR target/24894
        PR target/31644
        PR target/31786
        * config/avr/avr.c (legitimate_address_p): Fix problem where subreg
        is not recognized as a valid register usage. Allow REG_X to be used
        as a base pointer.
        * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Remove code that
        forces a reload when using a base register.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.h


-- 


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.3/4.4/4.5 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (17 preceding siblings ...)
  2008-09-14 12:53 ` aesok at gcc dot gnu dot org
@ 2009-03-31 20:09 ` jsm28 at gcc dot gnu dot org
  2009-08-04 12:39 ` rguenth at gcc dot gnu dot org
  2010-01-29 17:46 ` [Bug target/31786] [avr] " eric dot weddington at atmel dot com
  20 siblings, 0 replies; 22+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 20:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jsm28 at gcc dot gnu dot org  2009-03-31 20:09 -------
Closing 4.2 branch.  Is the patch committed on 14 September 2008 a complete
fix?  If so, the 4.4 and 4.5 regression markers should be removed from the
summary.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aesok at gcc dot gnu dot org
            Summary|[4.2/4.3/4.4/4.5            |[4.3/4.4/4.5
                   |Regression][avr] error:     |Regression][avr] error:
                   |unable to find a register to|unable to find a register to
                   |spill in class              |spill in class
                   |'BASE_POINTER_REGS'         |'BASE_POINTER_REGS'
   Target Milestone|4.2.5                       |4.3.4


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [4.3/4.4/4.5 Regression][avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (18 preceding siblings ...)
  2009-03-31 20:09 ` [Bug target/31786] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:39 ` rguenth at gcc dot gnu dot org
  2010-01-29 17:46 ` [Bug target/31786] [avr] " eric dot weddington at atmel dot com
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from rguenth at gcc dot gnu dot org  2009-08-04 12:28 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Bug target/31786] [avr] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
  2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
                   ` (19 preceding siblings ...)
  2009-08-04 12:39 ` rguenth at gcc dot gnu dot org
@ 2010-01-29 17:46 ` eric dot weddington at atmel dot com
  20 siblings, 0 replies; 22+ messages in thread
From: eric dot weddington at atmel dot com @ 2010-01-29 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from eric dot weddington at atmel dot com  2010-01-29 17:45 -------
I have in my list that this bug as fixed in 4.4.0. Closing.


-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.3 Regression][avr] error:|[avr] error: unable to find
                   |unable to find a register to|a register to spill in class
                   |spill in class              |'BASE_POINTER_REGS'
                   |'BASE_POINTER_REGS'         |
   Target Milestone|4.3.5                       |4.4.0


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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-01-29 17:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-02 13:14 [Bug target/31786] New: error: unable to find a register to spill in class 'BASE_POINTER_REGS' ralf_corsepius at rtems dot org
2007-05-02 19:34 ` [Bug target/31786] " eweddington at cso dot atmel dot com
2007-05-03  9:27 ` ralf_corsepius at rtems dot org
2007-05-03  9:43 ` ralf_corsepius at rtems dot org
2007-05-03 12:05 ` eweddington at cso dot atmel dot com
2007-05-03 12:12 ` ralf dot corsepius at rtems dot org
2007-05-03 13:07 ` ralf_corsepius at rtems dot org
2007-05-03 14:21 ` ralf_corsepius at rtems dot org
2007-05-03 15:40 ` eweddington at cso dot atmel dot com
2007-05-04 15:06 ` eweddington at cso dot atmel dot com
2007-05-30 20:40 ` [Bug target/31786] [4.1/4.2/4.3 Regression][avr] " eweddington at cso dot atmel dot com
2007-06-10 16:43 ` eweddington at cso dot atmel dot com
2007-06-10 16:50 ` eweddington at cso dot atmel dot com
2007-07-04  3:06 ` mmitchel at gcc dot gnu dot org
2008-01-02 13:44 ` hutchinsonandy at netscape dot net
2008-01-02 23:46 ` hutchinsonandy at netscape dot net
2008-01-13 16:04 ` rguenth at gcc dot gnu dot org
2008-07-04 22:03 ` [Bug target/31786] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-09-14 12:53 ` aesok at gcc dot gnu dot org
2009-03-31 20:09 ` [Bug target/31786] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:39 ` rguenth at gcc dot gnu dot org
2010-01-29 17:46 ` [Bug target/31786] [avr] " eric dot weddington at atmel dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).