<< Back to previous view

[PCC-337] cannot pass long double function argument Created: 27/Apr/11  Updated: 29/Apr/11

Status: Closed
Project: pcc
Component/s: C frontend
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 following code example

void foo(long double);

void bar(long double a)
{
        foo(a);
}

fails to compile, producing "line 5: compiler error: Cannot generate code, node 0xbb901800 op FUNARG"

 Comments   
Comment by Anders Magnusson [ 28/Apr/11 04:34 PM ]
Can you elaborate on this? I have no problem compiling the code above (with any flags).
Comment by Iain Hibbert [ 29/Apr/11 10:06 AM ]
Hm. I have two methods for building pcc

1. via the pcc make system, to get /usr/tools/bin/i486--netbsdelf-pcc, and
    this binary handles the above source just fine

2. via the NetBSD make system, to get /usr/bin/pcc, and the ccom built here
    produces the following output (no args, just the source)

        .text
        .align 4
        .globl bar
        .type bar,@function
bar:
<stdin>, line 5: compiler error: Cannot generate code, node 0xbb9017f0 op FUNARG
0xbb9016fc) CALL, uchar, REG %eax , SU= 0(@REG,,,,,,)
    0xbb901274) ICON $foo, PTR FTN uchar, REG %eax , SU= 0(@REG,,,,,,)
    0xbb9017f0) FUNARG, ldouble, REG %eax , SU= 0(@REG,,,,,,)
        0xbb901848) OREG 8(%ebp), ldouble, REG %eax , SU= 0(@REG,,,,,,)

The second build method does add some other flags (SSP for instance, and -O2) and allows
cross building as part of NetBSD release, will look into that and see if I can find what might
be different..
Comment by Iain Hibbert [ 29/Apr/11 10:28 AM ]
Apologies, this was not a pcc issue and can be closed

it was caused by lack of -DGCC_COMPAT when building mkext in the NetBSD build
Generated at Sun Aug 31 12:18:41 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.