[Fwd: BUG: 2.95.1 19990809 (sparc-sun-solaris2.5.1)]

Fred Richardson frichard@bbn.com
Fri Oct 1 00:00:00 GMT 1999


Hello,

I have a bit more information on this bug.  It appears to be closely related
to another bug report:

	< http://egcs.cygnus.com/ml/gcc-bugs/1999-08/msg00255.html >

I've also verified that the bug is in GCC-2.95 (using binutils 2.9.1.0.25). 

As mentioned in my previous email, if I compile the test program without
-mcpu=ultrasparc, the program runs through without a bus error.  I compared
the assembly code and found the following difference in setting up the call
to `printf':

Without -mcpu=ultrasparc:

	ld	[%fp-20], %o1
	ld	[%fp-20], %o0
	ld	[%o0+4], %f2
	fstod	%f2, %f4
	std	%f4, [%fp-16]
	ldd	[%fp-16], %o2
	ld	[%fp-20], %o4
	ld	[%fp-20], %o5
	ld	[%fp-20], %o0
	ld	[%o0+16], %f2
	fstod	%f2, %f4
	st	%f4, [%sp+92]
	st	%f5, [%sp+96]
	sethi	%hi(.LLC4), %g2
	or	%g2, %lo(.LLC4), %o0
	ld	[%o1], %o1
	ld	[%o4+8], %o4
	ld	[%o5+12], %o5
	call	printf, 0
	 nop

With -mcpu=ultrasparc:

	ld	[%fp-20], %o1
	ld	[%fp-20], %o0
	ld	[%o0+4], %f2
	fstod	%f2, %f4
	std	%f4, [%fp-16]
	ldd	[%fp-16], %o2
	ld	[%fp-20], %o4
	ld	[%fp-20], %o5
	ld	[%fp-20], %o0
	ld	[%o0+16], %f2
	fstod	%f2, %f4
	std	%f4, [%sp+92]
	sethi	%hi(.LLC4), %g2
	or	%g2, %lo(.LLC4), %o0
	ld	[%o1], %o1
	ld	[%o4+8], %o4
	ld	[%o5+12], %o5
	call	printf, 0
	 nop


So, the difference is that the two `ld' instructions are replaced with a
single `std' instruction.  Following the bug reported above in
`msg00255.html', I modified the `ldd' instruction so that the store adress is
divisable by 8:

	std	%f4, [%sp+96]

and recompiled.  Viola!  The bus error went away.

I went back and looked at the EGCS-1.1.1 assembly output with
-mcpu=ultrasparc: there were no calls to `ldd', but instead the code looked
like I hadn't specified -mcpu=ultrasparc.

	Hope that helps,

		-Fred



More information about the Gcc-help mailing list