Bug 20518 - Clobber registers,in inline asm. Problem when using rcall
Summary: Clobber registers,in inline asm. Problem when using rcall
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2005-03-17 14:37 UTC by Bjarne Laursen
Modified: 2010-11-07 05:47 UTC (History)
4 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Testcase with listfile (3.29 KB, application/x-zip-compressed)
2005-03-17 14:41 UTC, Bjarne Laursen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bjarne Laursen 2005-03-17 14:37:04 UTC
When register are listet as clobbert, they are used anyway for local variables 
if the inline assembly code uses rcall. The r1 (zeroreg) is not restored even 
if it is clobbert.
None of these problems genrates error or warnings.
Comment 1 Bjarne Laursen 2005-03-17 14:41:18 UTC
Created attachment 8410 [details]
Testcase with listfile

This show the wrong generated code.
Comment 2 Georg-Johann Lay 2010-11-06 13:05:46 UTC
please close this.

it's pretty much outdated and abuses inline asm to shred ABI
Comment 3 Ian Lance Taylor 2010-11-07 05:47:58 UTC
In gcc mainline I get

Main.c: In function ‘Foo’:
Main.c:26:1: error: r28 cannot be used in asm here
Main.c:26:1: error: r29 cannot be used in asm here

so this appears to be fixed.