Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!munnari.oz.au!goanna!minyos.xx.rmit.oz.au!s900387 From: s900387@minyos.xx.rmit.oz.au (Craig Macbride) Newsgroups: comp.unix.aix Subject: cc -O producing faulty code Message-ID: <1991Jun1.065826.5526@minyos.xx.rmit.oz.au> Date: 1 Jun 91 06:58:26 GMT Distribution: comp Organization: Royal Melbourne Institute of Technology, Melbourne, Australia Lines: 14 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 / \ \_.--.*/ The above are simply my comments, not necessarily v the views of any other being or organisation.