-
Notifications
You must be signed in to change notification settings - Fork 13.5k
_Complex _BitInt is inconsistently/incorrectly lowered #119352
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
@llvm/issue-subscribers-clang-codegen Author: Bevin Hansson (bevin-hansson)
See the following program: https://godbolt.org/z/YhdKov4x1
There's a number of inconsistencies in how this is emitted.
|
@AaronBallman Are complex bitints even (supposed to be) a thing? Please say no |
According to the standard IMO only floating complex types are allowed:
From what I can google, accepting integer _Complex types is a gcc extension https://gcc.gnu.org/onlinedocs/gcc/Complex.html . However gcc doesn't accept _Complex _BitInt. We probably need to decide if we want to support _Complex _BitInt as clang extension? To codegen this correctly, approach taken in #91364 needs to be extended to take care of complex types. |
I would think that unless we have a good reason to (and I don't really see one yet?) or someone who is volunteering to do the work, that just rejecting complex |
The C standard doesn't require support for these types and Codegen for these types is incorrect ATM. See llvm#119352
The C standard doesn't require support for these types and Codegen for these types is incorrect ATM. See #119352
Should this ticket be closed, then? |
Fixed in #119402 |
@llvm/issue-subscribers-clang-frontend Author: Bevin Hansson (bevin-hansson)
See the following program: https://godbolt.org/z/YhdKov4x1
There's a number of inconsistencies in how this is emitted.
|
See the following program: https://godbolt.org/z/YhdKov4x1
There's a number of inconsistencies in how this is emitted.
sizeof(_Complex _BitInt(144))
is 48, but the actual size of the declared variable is 64.A struct with two
_BitInt
s has a size of 48, both in sizeof and allocation.The code in the
set
function is wrong:If we allocate a memory area of size 48 and then perform these stores, we will write outside of the allocation (32 + 18 = 50).
Compare this to the
set2
function, which designates the imaginary member at offset 24.The text was updated successfully, but these errors were encountered: