public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50289] New: [avr]: call-prologues saveing/restoring global register variables Date: Sun, 04 Sep 2011 21:52:00 -0000 [thread overview] Message-ID: <bug-50289-4@http.gcc.gnu.org/bugzilla/> (raw) 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()
next reply other threads:[~2011-09-04 21:52 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-04 21:52 gjl at gcc dot gnu.org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-50289-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).