<< Back to previous view

[PCC-363] ulltofp() refers to constant in wrong manner with -fPIC Created: 25/Jun/11  Updated: 01/Jul/11

Status: Resolved
Project: pcc
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: NetBSD/i386


 Description   
The ulltofp() function in local2.c emits code to convert from an unsigned long long value,
but when -fPIC is passed it refers to a constant in the wrong way.. the following snippet
shows the problem

float /* or double */
foo(unsigned long long a)
{
    return a;
}

when compiled with -fPIC produces

[...]
        .data
.L15: .long 0,0x80000000,0x403f
        .text
        pushl %edx
        pushl %eax
        fildq (%esp)
        addl $8,%esp
        cmpl $0,%edx
        jge .L16
        fldt .L15
        faddp %st,%st(1)
.L16:
[...]

and the fldt instruction should be using some kind of @GOTOFF notation?


 Comments   
Comment by Anders Magnusson [ 01/Jul/11 05:25 PM ]
Fixed, thanks.
Generated at Sun Dec 21 19:44:43 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.