On 03/02/2011 10:56, Drasko DRASKOVIC wrote:
On Thu, Feb 3, 2011 at 10:42 AM, David Brown<david@xxxxxxxxxxxxxxx> wrote:
My understanding is that "register" is ignored at -O1 and above, which would
seem to match your experience.
You wanted to say "-O1 and below", right ?
No, "register" is ignored at -O1 and above. When the optimiser is
enabled, /it/ decides whether data should go in a register, or has to go
on the stack, or can be eliminated entirely. It is only at -O0 that the
compiler puts everything on the stack by default, and puts "register"
data in registers. That's why the "register" keyword has been
considered redundant for many years - the compiler almost always does a
much better job than any human at deciding what data to put in registers.