Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 19636
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: dieter meier <dieterbmeier@yahoo.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
usart.i usart.i text/plain 2005-01-26 11:00 5.98 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 19636 depends on: Show dependency tree
Show dependency graph
Bug 19636 blocks: 24894

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2007-04-09 22:14 Opened: 2005-01-26 10:59
Hi, I'm testing gcc version 4.0.0 20050123:

avr-gcc -c  -Os  usart.i

usart.c: In function 'UsartIOCtl':
usart.c:821: error: unable to find a register to spill in class 
'BASE_POINTER_REGS'
usart.c:821: error: this is the insn:
(insn 653 159 160 14 (set (mem:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [32 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
usart.c:821: internal compiler error: in spill_failure, at reload1.c:1872



Maybe, PR12017 is related to this PR?

------- Comment #1 From dieter meier 2005-01-26 11:00 -------
Created an attachment (id=8073) [edit]
usart.i

------- Comment #2 From Eric Weddington 2005-02-10 18:59 -------
The testcase compiles successfully with avr-gcc on 3.3.2, and 3.4.3, using
-mmcu=atmega128.
Could someone with sufficient permissions please set the "Known To Work" field.

Dieter, could you confirm which device you're compiling for?

------- Comment #3 From Eric Weddington 2005-02-10 19:43 -------
Dieter, could you please try this out with a more recent snapshot?

------- Comment #4 From dieter meier 2005-02-10 21:44 -------
It still fails with  4.0.0 20050209.
BTW, it only fails with -Os. (-O0 to -O3 are OK)
3_4 branch is OK, too.

------- Comment #5 From Eric Weddington 2005-02-10 21:48 -------
Subject: Re:  Can't compile ethernut OS (avr-gcc)

dieterbmeier at yahoo dot com wrote:

>------- Additional Comments From dieterbmeier at yahoo dot com  2005-02-10 21:44 -------
>It still fails with  4.0.0 20050209.
>BTW, it only fails with -Os. (-O0 to -O3 are OK)
>3_4 branch is OK, too.
>
>  
>
Which device are you compiling for? (-mmcu=?)

------- Comment #6 From dieter meier 2005-02-10 22:04 -------
>Which device are you compiling for? (-mmcu=?)

atmega128

------- Comment #7 From andy hutchinson 2005-02-13 02:07 -------
Try patch attached to PR 18251. Good chance it will fix.
If not, pass me the source for a llok at.



------- Comment #8 From dieter meier 2005-02-22 10:41 -------
>Try patch attached to PR 18251. Good chance it will fix.

I still fails. (18251.patch.bz2 applied)

>If not, pass me the source for a llok at.


Its already attached to this pr.

http://gcc.gnu.org/bugzilla/attachment.cgi?id=8073&action=view

------- Comment #9 From berndtrog@yahoo.com 2005-04-30 17:41 -------
I can confirm this bug for 4_0 and head (using -Os).

Note:
gcc-head-2004-12-07 compiles usart.i OK.
gcc-head-2004-12-29 fails with:

usart.c: In function 'UsartIOCtl':
usart.c:821: error: unable to find a register to spill in class 'BASE_POINTER_REGS'
usart.c:821: error: this is the insn:
(insn 653 159 160 14 (set (mem:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [32 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
usart.c:821: internal compiler error: in spill_failure, at reload1.c:1873

------- Comment #10 From Eric Weddington 2005-05-05 18:09 -------
Will someone with the requisite permissions please set this bug to NEW? This
has
been confirmed.

Thanks
Eric

------- Comment #11 From berndtrog@yahoo.com 2005-12-05 18:34 -------
Compiling of usart.i still fails:

usart.c: In function 'UsartIOCtl':
usart.c:821: error: unable to find a register to spill in class
'BASE_POINTER_REGS'
usart.c:821: error: this is the insn:
(insn 663 162 163 14 (set (mem:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [31 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
usart.c:821: confused by earlier errors, bailing out

Tested with: 4.0.3 20051123, 4.1.0 20051202, 4.2.0 20051202

It compiles OK with 3.4.5 

------- Comment #12 From plessl@tik.ee.ethz.ch 2006-10-11 08:44 -------
I can confirm that this bug still exists on with avr-gcc (GCC) 4.0.2 (running
on Mac OS X 10.4.8/PPC, installed via Macports)

avr-gcc -Os ~/Documents/Downloads/usart.iusart.c: In function ‘UsartIOCtl’:
usart.c:821: error: unable to find a register to spill in class
‘BASE_POINTER_REGS’
usart.c:821: error: this is the insn:
(insn 663 162 163 14 (set (mem:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [31 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
usart.c:821: confused by earlier errors, bailing out


Is there any news on this bug? 

------- Comment #13 From Eric Weddington 2006-10-11 17:05 -------
(In reply to comment #12)
> I can confirm that this bug still exists on with avr-gcc (GCC) 4.0.2 (running
> on Mac OS X 10.4.8/PPC, installed via Macports)
<snip>
> Is there any news on this bug? 

Sorry, no. Your comment has been the latest news.

Can you try using GCC 4.1.1 and see if you can still reproduce this bug? That
would be very informative.

------- Comment #14 From plessl@tik.ee.ethz.ch 2006-10-17 14:43 -------
(In reply to comment #13)
> Can you try using GCC 4.1.1 and see if you can still reproduce this bug? That
> would be very informative.

Yes, the bug is still present in gcc-4.1.1, see below. I also had problems
building gcc-4.1.1 for avr. libssp doesn't compile for this target, hence I had
to disable it  by passing --disable-libssp to configure.

usart.c: In function ‘UsartIOCtl’:
usart.c:821: error: unable to find a register to spill in class
‘BASE_POINTER_REGS’
usart.c:821: error: this is the insn:
(insn 663 162 163 14 (set (mem/c:HI (plus:HI (reg/f:HI 28 r28)
                (const_int 1 [0x1])) [27 S2 A8])
        (reg:HI 24 r24)) 12 {*movhi} (nil)
    (nil))
usart.c:821: confused by earlier errors, bailing out

------- Comment #15 From Mustafa Yuecel 2006-10-27 10:31 -------
Found an important hint:

If the switch instruction is replaced with else ifs, the file is also
compilable with the -Os option. It seems that the avr-gcc >4.0 can only
optimize a limited number of cases (the file usart.i has 33 cases in one switch
statement).

------- Comment #16 From Eric Weddington 2007-05-21 17:03 -------
Fails with 4.1.2.

------- Comment #17 From Eric Weddington 2007-05-21 17:09 -------
Fails on 4.2.0.

------- Comment #18 From Eric Weddington 2007-05-21 17:17 -------
Using the target specific option -mno-tablejump fixes the bug for 4.1.2 and
4.2.0.

------- Comment #19 From Eric Weddington 2007-05-30 18:59 -------
Testcase succeeds with 4.3-20070525, with all -O settings. Changing target
milestone to 4.3.0, lowering priority.

------- Comment #20 From Joseph S. Myers 2008-03-15 00:39 -------
Update milestone after 4.3.0 release.

------- Comment #21 From Joseph S. Myers 2008-05-19 20:22 -------
4.2.4 is being released, changing milestones to 4.2.5.

------- Comment #22 From Joseph S. Myers 2008-07-04 22:45 -------
Closing 4.1 branch.

------- Comment #23 From aesok@gcc.gnu.org 2008-09-14 12:51 -------
Subject: Bug 19636

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

------- Comment #24 From Joseph S. Myers 2009-03-30 15:39 -------
Closing 4.2 branch, reported as working with 4.3.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug