From: Andreas Schwab <hidden> Date: 2005-06-29 16:15:02
Frank van Maarseveen [off-list ref] writes:
What is the point of all those v->counter arguments?
It tells the compiler that v->counter is changed by the asm.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
From: Frank van Maarseveen <hidden> Date: 2005-06-29 18:36:29
On Wed, Jun 29, 2005 at 06:14:52PM +0200, Andreas Schwab wrote:
Frank van Maarseveen [off-list ref] writes:
quoted
What is the point of all those v->counter arguments?
It tells the compiler that v->counter is changed by the asm.
So it's an optimized alternative for "memory" in the clobber list?
ok, I couldn't find that anywhere in the doc.
But v->counter is not supposed to be accessed directly by the
compiler (i.e. by C code) at all, is it? so it shouldn't matter.
Even if it would be: the counter itself is declared "volatile int"
which basically tells the compiler not to cache it in a register.
--
Frank
From: Andreas Schwab <hidden> Date: 2005-06-29 22:34:15
Frank van Maarseveen [off-list ref] writes:
But v->counter is not supposed to be accessed directly by the
compiler (i.e. by C code) at all, is it? so it shouldn't matter.
Even if it would be: the counter itself is declared "volatile int"
which basically tells the compiler not to cache it in a register.
Never lie to the compiler, or it gets its revenge, sooner or later.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."