Do not spill variables/registers on the stack

Drasko DRASKOVIC drasko.draskovic@gmail.com
Thu Feb 3 22:36:00 GMT 2011


Back to the topic, few things crossed my mind :

1) Register keyword is a "hint" to the compiler, and thus not
obligatory. We saw that for -O1 and above it is "useless hint", as it
is always ignored. Is it however always respected by GCC when -O0 ? If
yes - why is it a hint ? If no, in which cases it is not respected ?
Only when you assign more vars than you have reg, or GCC might ignore
it some other times even with -O0 ?

2) Is this behavior documented anywhere ? Can we find docs that note :
    a) that "regiser" keyword is not ignored only with -O0
    b) when -O0 in which cases it is taken into account and in which cases not.


BR,
Drasko



More information about the Gcc-help mailing list