Comment 5 for bug 1112499

Revision history for this message
In , Gjl (gjl) wrote :

I can confirm this on current trunk r180962 with -Os/-O2/-O3.

The bug disappears with -fno-caller-saves.

I already observed trouble with -fcaller-saves together with -mstrict-X so that perhaps it is a good idea to disable that option for AVR?

A size comparison if avr-libc generated with -f[no-]caller-saves looks as follows:

Columns:

3nd = #bytes with -fcaller-saves
3rd = #bytes with -fno-caller-saves
4th = relative size gain
5th = absolute size gain

vfscanf_flt.o : 21197 21347 0.7% 150
realloc.o : 4110 4164 1.3% 54
vfprintf_std.o : 8858 8840 -0.2% -18
vfprintf_flt.o : 16604 16508 -0.6% -96
calloc.o : 636 540 -15.1% -96
strdup.o : 654 516 -21.1% -138
vfscanf_min.o : 9613 9433 -1.9% -180
vfscanf_std.o : 12918 12736 -1.4% -182
:::::: Total ::::::: : 322839 322333 -0.2% -506

Other object do not change in size.

Denis, what do you think: Should we kick off caller-saves alltogether? Appears that option increases register pressure/spill requests up to a level not appropriate for AVR.