open64-compiler / open64

open64 compiler
76 stars 29 forks source link

[SPEC2006]### Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:2051: ### Handle_arg_diff_ty: Parameter number is wrong, expected 0 got 2 #34

Open zqb-all opened 10 months ago

zqb-all commented 10 months ago

spec2k6 456.hmmer build fail. one of the errors can be reproduce by the following code:

static  int     (*qcmp)();      /* the comparison routine */

void specqsort(compar)
    int (*compar)();
{
    qcmp = compar;
    (*qcmp)(1, 2);
}

cmd:

xcalcc -c a.c

error:

2023-10-28 10:57:41,190 - xcalcc - ERROR - !!! Log: (null) :Translating specqsort(0)

!!! DevWarn: specqsort :Stmt2llvm: ingore PRAGMA stmt now

### Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:2051:
### Handle_arg_diff_ty: Parameter number is wrong, expected 0 got 2.
### For a.O in specqsort (xcalcc:583)
zqb-all commented 10 months ago
$riscv64-unknown-linux-gnu-gcc -S a.c
$ cat a.s
    .file   "a.c"
    .option nopic
    .attribute arch, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0"
    .attribute unaligned_access, 0
    .attribute stack_align, 16
    .text
    .local  qcmp
    .comm   qcmp,8,8
    .align  1
    .globl  specqsort
    .type   specqsort, @function
specqsort:
    addi    sp,sp,-32
    sd  ra,24(sp)
    sd  s0,16(sp)
    addi    s0,sp,32
    sd  a0,-24(s0)
    lui a5,%hi(qcmp)
    ld  a4,-24(s0)
    sd  a4,%lo(qcmp)(a5)
    lui a5,%hi(qcmp)
    ld  a5,%lo(qcmp)(a5)
    li  a1,2
    li  a0,1
    jalr    a5
    nop
    ld  ra,24(sp)
    ld  s0,16(sp)
    addi    sp,sp,32
    jr  ra
    .size   specqsort, .-specqsort
    .ident  "GCC: (g) 12.3.1 20230609"
    .section    .note.GNU-stack,"",@progbits