9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 6c + volatile
@ 2011-12-08 16:45 erik quanstrom
  0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2011-12-08 16:45 UTC (permalink / raw)
  To: 9fans

magic was declared alternately as an int, volatile int and int volatile.
(because i always get that backwards.) in all cases, the assembly was this:

main+0x168 0x0020039d	MOVL	magic(SB),CX
main+0x16f 0x002003a4	CMPL	CX,$0x1
main+0x172 0x002003a7	JNE	main+0x16f(SB)

perhaps i'm not reading the standard correctly, but i would have expected

vloop:
	MOVL	magic(SB), CX
	CMPL	CX, $1
	JNE	vloop

instead.  obviously, this doesn't happen when magic is an int*.

- erik



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-08 16:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-08 16:45 [9fans] 6c + volatile erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).