Optimizing Compilers

BostonU SysMgr root%bostonu.csnet at csnet-relay.arpa
Wed Jan 2 07:37:17 AEST 1985


	Ok, enough of this silliness that
	an optimizer must NEVER change the
	effect of a piece of code. Consider
	the following:

	for(i=0 ; i < MAX ; i++)
		x[i] = y/z ;

	now, obviously y/z is loop invariant...
	the optimizer decides to compute
	it once:

	temp = y/z ;
	for(i=0; i < n ; i++) x[i] = temp ;

	reasonable, but what the optimizer
	does not know is I did a:

		signal(SIGFPE,print_msg_and_ignore) ;

	earlier. W/o the optimizer the msg gets printed
	n times, with it only once.

	OK, you say, that's a special case of an error.
	The point is where do you draw the line? Not
	that an optimizer should NEVER change an effect.

		-Barry Shein, Boston University



More information about the Comp.unix.wizards mailing list