avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Register allocator performing worse in avr-gcc-5.x?


From: Thilo Schulz
Subject: [avr-gcc-list] Register allocator performing worse in avr-gcc-5.x?
Date: Tue, 06 Oct 2015 22:09:06 +0200
User-agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

Hello,

there's one thing I have noticed when compiling with avr-gcc-5.2.0, and it is
that compared to avr-gcc.4.8.1, it generates larger binaries and optimizes
worse, while using identical compilation flags, especially when under high
register pressure.

Case in point:
http://thilo.tjps.eu/avrtest.c
This is an excerpt from one of my programs designed the show the
different behaviour.

Compile with:
avr-gcc-5.2.0 -ggdb3 -Wall -Wno-volatile-register-var -mmcu=attiny13a -Os -o 
test.o -c test.c
avr-gcc-4.8.1 -ggdb3 -Wall -Wno-volatile-register-var -mmcu=attiny13a -Os -o 
test.o -c test.c

The 5.2.0 version spills many registers, while the 4.8.1 has no
need to do so. I'd appreciate if you could have a look into this.

About the "volatile" keyword in front of the global register variable:
Feel free to try what happens when you remove this keyword. That in itself
is interesting, and this behaviour is exhibited by both compiler versions.

-- 
Best regards,
Thilo Schulz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]