cc -O producing faulty code

hbergh at nl.oracle.com hbergh at nl.oracle.com
Mon Jun 10 07:16:16 AEST 1991


In article <1991Jun2.124226.17523 at minyos.xx.rmit.oz.au> s900387 at minyos.xx.rmit.oz.au (Craig Macbride) writes:
>drake at drake.almaden.ibm.com writes:
>
>>How about posting an example, and the level of AIX you're running?
>
>Release 1, Version 3. An example follows, with test script and result. You
>will notice that I've put the optimised program's output through "cat -v" to
>make it at least keep to ASCII characters. :-)

	That's very good! Although Jim probably wanted to know the update
	level of the C compiler. You can see what that is by typing
	'lslpp -h xlccmp.obj' and look for the line with ACTIVE.
	You can also have the compiler generate a listing with -qsource
	or -qlist (assembly) and its version number will be on the first line.

	Your test shows the problem with the 1.1.1.1 compiler (also shipped
	with xlccmp.obj 1.1.2.15) and can be solved by adding the 
	-U__STR__ option, as Bjorn Engsig pointed out in an earlier post.
	This will tell the compiler not to inline strcmp and strcpy.

	The xlc compiler version 1.1.3.13 that is shipped with xlccmp.obj
	1.1.5.10 (3005 update, aka AIX 3.1.5) doesn't have this problem.

> _--_|\		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.



	Regards,

	Herbert van den Bergh                    hbergh at oracle.com
	Oracle Europe                            or uunet!oracle!hbergh
-- 

	Regards,

	Herbert van den Bergh                    hbergh at oracle.com



More information about the Comp.unix.aix mailing list