This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/53033] New: [avr]: Wrong register number for 3-byte loads via X


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]