public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56219] New: avr-gcc-4.7.2 missing __uint24 loop optimisation
@ 2013-02-06  7:37 demiurg_spb at freemail dot ru
  2013-02-06 12:35 ` [Bug target/56219] " demiurg_spb at freemail dot ru
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: demiurg_spb at freemail dot ru @ 2013-02-06  7:37 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56219

             Bug #: 56219
           Summary: avr-gcc-4.7.2 missing __uint24 loop optimisation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: demiurg_spb@freemail.ru


int main(void)
{
//    static const unsigned long __flash br[8] = {0,}; // case1: 194 bytes
    static const __uint24      __flash br[8] = {0,}; // case2: 190 bytes
(should be case1 minus 8 bytes)

    unsigned char i=0;

    for (;;i++)
    {
        *((volatile unsigned char*)100) = br[i%8];
    }

    return (0);
}

//case1: avr-gcc-4.7.2 -S -mmcu=atmega8 -Os main.c
    ldi r24,0
.L2:
    mov r30,r24
    andi r30,lo8(7)
    ldi r25,lo8(4)
    mul r30,r25
    movw r30,r0
    clr __zero_reg__
    subi r30,lo8(-(br.1322))
    sbci r31,hi8(-(br.1322))
    lpm r25,Z
    sts 100,r25
    subi r24,lo8(-(1))
    rjmp .L2

//case2: avr-gcc-4.7.2 -S -mmcu=atmega8 -Os main.c
    ldi r18,0
.L2:
    mov r24,r18
    andi r24,lo8(7)
    ldi r25,0
    movw r30,r24
    lsl r30
    rol r31
    add r30,r24
    adc r31,r25
    subi r30,lo8(-(br.1322))
    sbci r31,hi8(-(br.1322))
    lpm r24,Z
    sts 100,r24
    subi r18,lo8(-(1))
    rjmp .L2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-12 20:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06  7:37 [Bug c/56219] New: avr-gcc-4.7.2 missing __uint24 loop optimisation demiurg_spb at freemail dot ru
2013-02-06 12:35 ` [Bug target/56219] " demiurg_spb at freemail dot ru
2013-02-06 13:06 ` demiurg_spb at freemail dot ru
2013-04-12 20:05 ` gjl at gcc dot gnu.org

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).