cc and gcc problems

David Berry dwb at sticks.apple.com
Thu May 3 06:58:14 AEST 1990


In article <12749 at smoke.BRL.MIL> cjohnson at smoke.BRL.MIL (Christopher T. Johnson) writes:
>On a related note the verion of gcc(1.37) available from apple.com
>generates bad code.  I have two test cases that fail.  In both cases
>the code was checking to see if a double was near zero.
>
>	{double junk = 0.0;
>		if (junk <0.0001 && junk > -0.0001) {
>			fprintf(stderr,"junk almost equal zero\n");
>		} else {
>			fprintf(stderr,"junk != zero ??????\n");
>		}
>	}
	Actually, this is a bug in the A/UX assembler.  Gcc is generating
	valid code that the assembler generates byte code for.  To get around
	it, always use the -O option (optimize) when dealing with floating
	point constants.
	David W. Berry			A/UX Toolbox Engineer
	dwb at apple.com



More information about the Comp.unix.aux mailing list