[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] optimizer
From: |
Bernard Fouché |
Subject: |
[avr-gcc-list] optimizer |
Date: |
Wed, 24 Nov 2004 12:18:11 +0100 |
Hi.
I'm compiling with -Os for atmega64 with avr-gcc 3.4.2. When I have
uint32_t var;
var=(uint32_t)function_returning_an_int8_t();
the generated code is, for instance:
var=(uint32_t)eeprom_read_byte((uint8_t *)EEPROM_PARM);
ldi r24, 0x36 ; 54
ldi r25, 0x00 ; 0
call 0xf9c0
eor r25, r25
eor r26, r26
eor r27, r27
sts 0x046B, r24
sts 0x046C, r25
sts 0x046D, r26
sts 0x046E, r27
Could it be instead:
ldi r24, 0x36 ; 54
ldi r25, 0x00 ; 0
call 0xf9c0
sts 0x046B, r24
sts 0x046C, r1
sts 0x046D, r1
sts 0x046E, r1
That would spare 6 bytes...
Bernard
- [avr-gcc-list] optimizer,
Bernard Fouché <=