[comp.lang.c] volatile: how will it work here?

wsmith@mdbs.UUCP (Bill Smith) (06/22/88)

What code will this program generate?:

volatile int avar;
main()
{
	avar;
}

As I understand it, the code should be something like:
	LD	R0,avar
	RET

How many compilers optimize this program because of its "lack of 
side-effects?"

Bill Smith	pur-ee!uiucdcs!wsmith	wsmith@cs.uiuc.edu