Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!cca!decvax!harpo!seismo!rlgvax!cvl!umcp-cs!chris
From: chris@umcp-cs.UUCP
Newsgroups: net.unix-wizards,net.lang.c
Subject: Re: Some questions about the C -Optimiser
Message-ID: <133@umcp-cs.UUCP>
Date: Thu, 9-Jun-83 09:41:32 EDT
Article-I.D.: umcp-cs.133
Posted: Thu Jun  9 09:41:32 1983
Date-Received: Fri, 10-Jun-83 01:34:28 EDT
References: ucbvax.232
Lines: 25

(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)