volatile: how will it work here?

Bill Smith wsmith at mdbs.UUCP
Wed Jun 22 03:47:38 AEST 1988


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 at cs.uiuc.edu



More information about the Comp.lang.c mailing list