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: [email protected]
ReportedBy: [email protected]
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.