[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Pointer register allocation optimizer
From: |
Wouter van Gulik |
Subject: |
[avr-gcc-list] Pointer register allocation optimizer |
Date: |
Fri, 27 Jul 2012 15:40:36 +0200 |
User-agent: |
SquirrelMail/1.4.18 |
Hi list,
This code:
char* f(char* p)
{
p++;
return p;
}
Results in:
mov r18,r24
mov r19,r25
subi r18,lo8(-(1))
sbci r19,hi8(-(1))
mov r24,r18
mov r25,r19
ret
When compiling with avr-gcc -O[23s] -mmcu=avr5 -S main.c
Which is bad since it could have been:
adiw r24, 1
ret
I tested against WinAVR's 4.3.3 and avr-gcc-4.7-185693-mingw32
Both generate the same code.
Should I create a bug report?
Wouter
- [avr-gcc-list] Pointer register allocation optimizer,
Wouter van Gulik <=