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

C99: Support for Complex Floats and tgmath.h #10

Merged
merged 41 commits into from
Jan 23, 2020
Merged

C99: Support for Complex Floats and tgmath.h #10

merged 41 commits into from
Jan 23, 2020

Conversation

michael-schwarz
Copy link
Member

@michael-schwarz michael-schwarz commented Jan 17, 2020

  1. Add new ftypes: FComplexFloat, FComplexDouble, FComplexLongDouble
  2. Add __imag__ and __real__
  3. Add special handling for __builtin_classify_type
  4. Fix conditionalConversion to conform to ISO 6.5.15 (regarding type of 0 ? a : b where a is a null pointer constant and b is a pointer type)
  5. Add special handling for __builtin_tg_math
  6. Handle macros that tgmath expands to correctly. This requires 3. and 4. for GCC <8, and 5. for GCC >= 8
  7. Various fixes related to tests failing on MacOS because gcc is an alias for clang in MacOS by default.

See also #8 and #9

and make connection with cabs
References #8, References #9
Is needed for support for tgmath.h
Add special treatment of __builtin_classify_type to Cabs, just like for example for __typeof__.
Turn into CLASSIFYTYPE, and in cabs2cil.ml evaluate it to the appropriate int constant that GCC also uses.

This is necessary to be able to determine the correct type of the conditional expressions used for tgmath.h.
The correct type for an expression such as
0 ? (float *) 0 :  (void*) (__builtin_classify_type(...) == X) depends on whether the last argument is a null pointer constant.
`(void*) (__builtin_classify_type(...) == X)` is a nullptr constant iff `__builtin_classify_type(...) == X` is zero.
To determine this it is neccessary to evaluate __bulitin_classify_type(...).
Requires running ./configure after pulling if it is not a fresh checkout

Should mean complex and tgmath work now, more tests needed though. References #8, References #9
iF can also be written Fi
i is the same as Di
References #8, References #9
gcc is an alias for clang by default, causing tests that rely on gcc specifics to fail
Was not ignored in GCC 7 (with warning), causes error in GCC 9
Build config validation warns:  deprecated key sudo (The key `sudo` has no effect anymore.)
Instead of giving include path directly, hopefullt this fixes failing build for OCaml 4.08 on MacOS
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

Successfully merging this pull request may close these issues.

1 participant