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 not support global and static char a[10] = {"hello"}; #26

Open
zqb-all opened this issue Aug 24, 2023 · 0 comments
Open

Xcalcc not support global and static char a[10] = {"hello"}; #26

zqb-all opened this issue Aug 24, 2023 · 0 comments
Labels
bug w2ll WHIRL to LLVM

Comments

@zqb-all
Copy link

zqb-all commented Aug 24, 2023

char a1[10] = {"hello"};  //ng1

int main()
{
        char a2[10] = {"hello"};
        char a3[10] = "hello";
        static char a4[10] = {"hello"};  //ng2
        static char a5[10] = "hello";  
        static char a6[10] = {};
        static char a7[10] = {'h'};
        static char a8[10] = {'h','e','l','l','o'};
}

for a1[10], xcalcc log:

2023-08-24 14:04:57,428 - xcalcc - ERROR - !!! Log: (null) :Translating main(0)

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

### Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:1265:
### Wty2llvmty: constant string should be array
### For array.O in main (xcalcc:580)

for a4[10], xcalcc log:

2023-08-24 14:05:27,382 - xcalcc - ERROR - !!! Log: (null) :Translating main(0)


### Assertion failure ../../../../osprey/ir_tools/whirl2llvm.cxx:1265:
### Wty2llvmty: constant string should be array
### For array.O in main (xcalcc:580)
@Yvan-xy Yvan-xy added bug w2ll WHIRL to LLVM labels Aug 24, 2023
zengdage added a commit to zengdage/open64 that referenced this issue Jan 4, 2024
1. the w2ll will crash if compile the code like that:
```
char a[10] = {"hello"};
int main(void)
{
   return sizeof(a);
}
```

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
bug w2ll WHIRL to LLVM
Projects
None yet
Development

No branches or pull requests

2 participants