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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

Thilo Schulz

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:
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

AVR-GCC-list mailing list
[hidden email]