This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: target/2273: [Alpha/Tru64 UNIX V5.1] SEGV in long double code
- To: gcc-gnats at gcc dot gnu dot org
- Subject: Re: target/2273: [Alpha/Tru64 UNIX V5.1] SEGV in long double code
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Tue, 3 Apr 2001 19:09:23 +0200 (MEST)
- Cc: gcc-bugs at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- References: <200103122136.WAA43228@bartok.TechFak.Uni-Bielefeld.DE><20010312214600.11860.qmail@sourceware.cygnus.com>
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