public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50289] New: [avr]: call-prologues saveing/restoring global register variables
@ 2011-09-04 21:52 gjl at gcc dot gnu.org
  2011-09-04 21:53 ` [Bug target/50289] [avr]: call-prologues saving/restoring " gjl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-04 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50289
           Summary: [avr]: call-prologues saveing/restoring global
                    register variables
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
                CC: eric.weddington@atmel.com
            Target: avr


void bar (long long, long long, void*);

register char x asm ("7");

void foo (char a)
{
    asm volatile ("":::"6");
    bar (0, 0, &a);
}


This small program, compiles with
   avr-gcc-4.6.1 -mcall-prologues -S -Os -mmcu=atmega8 
to

foo:
    ldi r26,lo8(1)
    ldi r27,hi8(1)
    ldi r30,lo8(gs(1f))
    ldi r31,hi8(gs(1f))
    jmp __prologue_saves__+((18 - 13) * 2)
1:

This means that __prologue_saves__ from libgcc saves R7 (i.e. R6..R17 and Y)
even though R7 is a global register variable and must not saved/restored by
function prologue/epilogue.

The function to fix is avr.c:sequent_regs_live()


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

end of thread, other threads:[~2011-09-05 12:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-04 21:52 [Bug target/50289] New: [avr]: call-prologues saveing/restoring global register variables gjl at gcc dot gnu.org
2011-09-04 21:53 ` [Bug target/50289] [avr]: call-prologues saving/restoring " gjl at gcc dot gnu.org
2011-09-05 12:21 ` gjl at gcc dot gnu.org
2011-09-05 12:24 ` gjl at gcc dot gnu.org
2011-09-05 12:27 ` gjl at gcc dot gnu.org

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).