This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]