Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site vax135.UUCP Path: utzoo!linus!genrad!grkermit!mit-vax!eagle!harpo!floyd!vax135!martin From: martin@vax135.UUCP Newsgroups: net.unix-wizards,net.lang.c Subject: Re: Some questions about the C -Optimiser Message-ID: <481@vax135.UUCP> Date: Thu, 9-Jun-83 23:02:10 EDT Article-I.D.: vax135.481 Posted: Thu Jun 9 23:02:10 1983 Date-Received: Fri, 10-Jun-83 11:45:19 EDT References: ucbvax.232 <133@umcp-cs.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 19 It would quite a problem to look for operations that would optimise out the usage of a register and check for then next statment to be a return. The better solution would be to do the calulation in another register if the result will not be passed to a return statment. Then the optimiser could check if the register was r0 and if so then not do the optimisation. This splits the work between the compiler and the optimiser. On another note, consider shell scripts to do edits on the asm file after it has been complied. Why not have a flag to cc to allow the passing of a program to be placed in the pipeline between c2 and as. How about:- $ cc main.c -O -SH :rofix -o main martin levy.