cc -O producing faulty code

Craig Macbride s900387 at minyos.xx.rmit.oz.au
Sat Jun 1 16:58:26 AEST 1991


I have found a situation where a perfectly simple piece of C code which does
some strcpy()s and fprintf()s works fine without the -O switch, but produces
code which generates incorrect output when -O is used. (The code produced by
the optimiser is also longer - I assume it's optimising for speed?)

Has anyone else come across this situation on an RS6000 before? I always used
to compile everything with -O on Unix machines, but it seems not a very safe
thing to do with this compiler.

-- 
 _--_|\		Craig Macbride	<s900387 at minyos.xx.rmit.oz.au>
/      \
\_.--.*/	The above are simply my comments, not necessarily
      v		the views of any other being or organisation.



More information about the Comp.unix.aix mailing list