Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcalcc: CastToTargetType: can't handle other src-type now #36

Open
zqb-all opened this issue Oct 28, 2023 · 0 comments
Open

Xcalcc: CastToTargetType: can't handle other src-type now #36

zqb-all opened this issue Oct 28, 2023 · 0 comments

Comments

@zqb-all
Copy link

zqb-all commented Oct 28, 2023

source code

#include <sys/time.h>
double foo()
{
        struct timeval tp;
        struct timezone tzp;
        int i;
        i = gettimeofday(&tp,&tzp);
        return tp.tv_sec;
}

cmd

xcalcc -c a.c

error log:

2023-10-28 11:29:37,337 - xcalcc - ERROR - !!! Log: (null) :Translating mysecond(0)

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

### Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:1985:
### CastToTargetType: can't handle other src-type now
### For simplemain.O in mysecond (xcalcc:583)
zengdage added a commit to zengdage/open64 that referenced this issue Jan 4, 2024
The icall or vfcall should support unproto type function.

1. The w2ll will crash if compile the code like that:
```
static  int             (*qcmp)();

void specqsort(base, n, size, compar)
    char    *base;
    int     n;
    int     size;
    int     (*compar)();
{
    char *min;
    while ((*qcmp)(min) > 0){}
}

```

2. Error Log:
```
Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:2056:
Handle_arg_diff_ty: Parameter number is wrong, expected 0 got 1.

Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:1985:
CastToTargetType: can't handle other src-type now

```

Signed-off-by: Zhijin Zeng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant