avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] RE: [Bug target/31786] error: unable to find a register t


From: Ralf Corsepius
Subject: [avr-gcc-list] RE: [Bug target/31786] error: unable to find a register to spill in class 'BASE_POINTER_REGS'
Date: Thu, 03 May 2007 15:17:04 +0200

On Thu, 2007-05-03 at 06:46 -0600, Eric Weddington wrote:
>  
> > -----Original Message-----
> > From: Ralf Corsepius [mailto:address@hidden 
> > Sent: Thursday, May 03, 2007 3:36 AM
> > To: address@hidden
> > Cc: address@hidden; Joel Sherrill
> > Subject: Re: [Bug target/31786] error: unable to find a 
> > register to spill in class 'BASE_POINTER_REGS'
> > 
> > On Thu, 2007-05-03 at 09:27 +0000, ralf_corsepius at rtems dot org
> > wrote:
> > > Eric, due to bugzilla's current brokenness, I am sending 
> > you the *.i on PM.
> > 
> > Please find enclosed.
> > 
> > The original failing call is this:
> > 
> >  
> > /users/rtems/src/rpms/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/b
> > uild/./gcc/xgcc 
> > -B/users/rtems/src/rpms/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0
> > /build/./gcc/ -nostdinc 
> > -B/users/rtems/src/rpms/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0
> > /build/avr-rtems4.8/newlib/ -isystem 
> > /users/rtems/src/rpms/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/b
> > uild/avr-rtems4.8/newlib/targ-include -isystem 
> > /users/rtems/src/rpms/BUILD/rtems-4.8-avr-rtems4.8-gcc-4.2.0/g
> > cc-4.2.0-20070501/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-20070501/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-20070501/newlib/libc/misc/'`init.c
> > ../../../../../../gcc-4.2.0-20070501/newlib/libc/misc/init.c: 
> > In function '__libc_fini_array':
> > ../../../../../../gcc-4.2.0-20070501/newlib/libc/misc/init.c:5
> > 9: error: unable to find a register to spill in class 
> > 'BASE_POINTER_REGS'
> > ../../../../../../gcc-4.2.0-20070501/newlib/libc/misc/init.c:5
> > 9: error: this is the insn:
> > (insn 84 55 56 4 
> > ../../../../../../gcc-4.2.0-20070501/newlib/libc/misc/init.c:5
> > 6 (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-20070501/newlib/libc/misc/init.c:5
> > 9: confused by earlier errors, bailing out
> > 
> > Removing -O2 (and hence picking up -Os) lets it succeed:
> 
> Hi Ralf,
> 
> I agree with your latest post on the bug report. 
> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31786>
> Yes, this is a real bug that does need to get fixed at some point.
c.f. to what I've just added to the PR - The code causing GCC to bomb
out is pretty trivial.

> However, as a workaround only, is there some reason why RTEMS cannot use
> avr-libc for the AVR?
Yes,
* RTEMS shares newlib between many targets
* RTEMS implements parts of the OS in newlib (RTEMS is pretty tied to
newlib)
* Licensing. GPL or LGPL is not acceptable for us (we want a more
liberal license).

>  Avr-libc is better maintained then newlib for the AVR
> target.
Well, newlib is largely independent of the target architecture. So the
avr specific part in newlib condenses to very few lines. 

I.e. instead of using "highly specialized functions", we are primarily
sharing c-code. This necessarily is not as "small" as a highly
specialized library, but ... that's one trade off to pay for
portability.

Ralf






reply via email to

[Prev in Thread] Current Thread [Next in Thread]