-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[llvm-gcc] Crash on structure with variable length array member #571
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
Comments
assigned to @lattner |
Hrm, interesting testcase. What exactly does this cause the compiler to compile -Chris |
llvm-gcc compiles it into the following: target endian = little implementation ; Functions: It compiles, but the code is incorrect. |
I suspected as much. I would rather keep this as a compile-fail bug than as a If you are feeling in a "hacking on the C/C++ front-end" kind of mood, you could -Chris |
Here's another expanded testcase that should be compiled correctly by any fix struct one { extern struct one hobbit; In other words, the CFE has to be able to adjust the type of an -Chris |
Here's an execution test for the problem. Once this is fixed, it should be -Chris /*
struct one hobbit = {5, {1, 2, 3}}; int main () {
|
John, I think you checked in your proposed fix for this bug, which changes it -Chris |
No reversion is necessary. This code still compile-fails under the current |
*** Bug llvm/llvm-bugzilla-archive#431 has been marked as a duplicate of this bug. *** |
*** Bug llvm/llvm-bugzilla-archive#654 has been marked as a duplicate of this bug. *** |
*** Bug llvm/llvm-bugzilla-archive#648 has been marked as a duplicate of this bug. *** |
*** Bug llvm/llvm-bugzilla-archive#649 has been marked as a duplicate of this bug. *** |
When working on this bug, please make sure that all of the marked duplicates are fixed before this one is -Chris |
llvm/llvm-bugzilla-archive#648 was reopened, it was actually a different bug. |
Testcase here: llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c -Chris |
This is fixed in llvmgcc4. |
mentioned in issue llvm/llvm-bugzilla-archive#200 |
This PR adds two new CIR floating-point types, namely `!cir.f16` and `!cir.bf16`, to represent the float16 format and bfloat format, respectively. This PR converts the clang extension type `_Float16` to `!cir.f16`, and converts the clang extension type `__bf16` type to `!cir.bf16`. The type conversion for clang extension type `__fp16` is not included in this PR since it requires additional work during CIRGen. Only CIRGen is implemented here, LLVMIR lowering / MLIR lowering should come next.
This PR adds two new CIR floating-point types, namely `!cir.f16` and `!cir.bf16`, to represent the float16 format and bfloat format, respectively. This PR converts the clang extension type `_Float16` to `!cir.f16`, and converts the clang extension type `__bf16` type to `!cir.bf16`. The type conversion for clang extension type `__fp16` is not included in this PR since it requires additional work during CIRGen. Only CIRGen is implemented here, LLVMIR lowering / MLIR lowering should come next.
This PR adds two new CIR floating-point types, namely `!cir.f16` and `!cir.bf16`, to represent the float16 format and bfloat format, respectively. This PR converts the clang extension type `_Float16` to `!cir.f16`, and converts the clang extension type `__bf16` type to `!cir.bf16`. The type conversion for clang extension type `__fp16` is not included in this PR since it requires additional work during CIRGen. Only CIRGen is implemented here, LLVMIR lowering / MLIR lowering should come next.
…er_amdeng/cherrypick-add-release Add release in device free when necessary (llvm#531)
This PR adds two new CIR floating-point types, namely `!cir.f16` and `!cir.bf16`, to represent the float16 format and bfloat format, respectively. This PR converts the clang extension type `_Float16` to `!cir.f16`, and converts the clang extension type `__bf16` type to `!cir.bf16`. The type conversion for clang extension type `__fp16` is not included in this PR since it requires additional work during CIRGen. Only CIRGen is implemented here, LLVMIR lowering / MLIR lowering should come next.
Extended Description
The llvm-gcc program crashes when it tries to compile the attached pre-processed
code. It occurs because we have an FIELD_DECL tree whose DECL_SIZE returns a
NULL_TREE. We deference this NULL_TREE with TREE_INT_CST_LOW, causing the error:
C-ctype.c:685: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.cs.uiuc.edu for instructions.
The source file comes from glibc.
I'm assigning it to myself for now since I've figured what is causing it, have
devised a hack to work around it, and am now looking at how to fix it correctly.
The text was updated successfully, but these errors were encountered: