Some questions about the C -Optimiser

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Thu Jun 9 23:41:32 AEST 1983


(This  is  a  reply  to mckusic's (sp?)  answer about not optimizing r0
references.)  Suggestion:    change  the  optimizer  to  go  ahead  and
optimize  if  the  r0  instructions  are  followed by anything except a
'ret'.  The C compiler will only generate an r0 instruction  that  also
includes the return value before a return(e), correct?

Another  question:    why  does  the optimizer only put sobgeq's around
``small'' loops?  Is this just running into the  limit  on  lines?    I
don't remember the specific example but it was something of the form

	if (expr) {
		while (--foo >= 0) {
			some; stmts;
		}
	}
	else {
		other; code;
	}
}

The  --foo  can  be  a  sobgeq but the jbr to the ret below stumped the
optimizer (is that as hard to read  as  it  sounds?).    I  got  it  to
optimize by adding a return after the while statement.

			- Chris (seismo!umcp-cs!chris)



More information about the Comp.lang.c mailing list