<< 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

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

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

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

Comment by Anders Magnusson [ 01/Jul/11 05:25 PM ]
Fixed, thanks.
Generated at Fri Oct 20 23:34:36 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.