target/2273: [Alpha/Tru64 UNIX V5.1] SEGV in long double code

Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Tue Apr 3 10:09:00 GMT 2001


I've single-stepped the test program and found the exact location where it
SEGVs:

int
main (void)
{
  long double ld = 1.0;
}

Here's an excerpt from the resulting assembler code:

	.rdata
	.quad 0
	.align 4
$LC0:
	.quad 0x000000000,0x3fff000000000000

and here's the relevant code for the assignment to ld, just after the
function prologue:

	lda $1,$LC0	; load address of ld into $1
	ldq $1,0($1)	; store high quad of ld into $1, overwriting &ld!
	ldq $2,8($1)	; the first quad of 1.0 happens to be 0, so 8($1)
			; dereferences a NULL pointer and SEGVs

Unfortunately, I cannot yet read the RTL dumps to understand why this is
happening.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

Email: ro@TechFak.Uni-Bielefeld.DE



More information about the Gcc-bugs mailing list