This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/53033] New: [avr]: Wrong register number for 3-byte loads via X
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Apr 2012 19:53:53 +0000
- Subject: [Bug target/53033] New: [avr]: Wrong register number for 3-byte loads via X
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53033
Bug #: 53033
Summary: [avr]: Wrong register number for 3-byte loads via X
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gjl@gcc.gnu.org
Target: avr
void foo (__int24 *p)
{
void bar (__int24);
asm ("" : "+x" (p));
bar (*++p);
}
Compile with
$ avr-gcc foo.c -S -Os
and the generated code is
foo:
mov r26,r24
mov r27,r25
adiw r26,3
ld r24,X+
ld r25,X+
ld r26,X
sbiw r26,3+2
rjmp bar
The destination register of the PSI move is always R24.