Summary: | ICC Error when including tgmath.h on Ubuntu 20.04 | ||
---|---|---|---|
Product: | glibc | Reporter: | Ahmet <ahmet.akkas> |
Component: | math | Assignee: | H.J. Lu <hjl.tools> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.33 | ||
Target Milestone: | 2.33 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2020-09-15 00:00:00 | |
Attachments: | A patch |
Description
Ahmet
2020-09-15 21:27:11 UTC
Created attachment 12843 [details]
A patch
Does ICC define __HAVE_FLOAT128?
Does ICC define __SIZEOF_FLOAT128__? Both GCC and clang define __SIZEOF_FLOAT128__ to 16: [hjl@gnu-cfl-1 glibc]$ echo __SIZEOF_FLOAT128__ | gcc -E - # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 31 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 32 "<command-line>" 2 # 1 "<stdin>" 16 [hjl@gnu-cfl-1 glibc]$ echo __SIZEOF_FLOAT128__ | clang -E - # 1 "<stdin>" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 341 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "<stdin>" 2 16 [hjl@gnu-cfl-1 glibc]$ The real question here is whether ICC supports any of the approaches used in glibc's tgmath.h to implement the type-generic macros, which involve various GCC extensions. If it doesn't support them, the "#if __GNUC_PREREQ (2, 7)" would need to change to disallow ICC, or else a new implementation approach would need to be added. If it does support them, then we get into ensuring the other macros regarding supported types are defined appropriately for the ICC case. (In reply to H.J. Lu from comment #2) > Does ICC define __SIZEOF_FLOAT128__? Yes. # 1 "-" # 1 "/usr/include/stdc-predef.h" 1 3 # 1 "-" 2 16 (In reply to Ahmet from comment #5) > (In reply to H.J. Lu from comment #2) > > Does ICC define __SIZEOF_FLOAT128__? > > Yes. > # 1 "-" > # 1 "/usr/include/stdc-predef.h" 1 3 > > # 1 "-" 2 > 16 Please apply my patch on /usr/include/bits/floatn.h to check if it fixes your ICC problem. (In reply to joseph@codesourcery.com from comment #4) > The real question here is whether ICC supports any of the approaches used > in glibc's tgmath.h to implement the type-generic macros, which involve > various GCC extensions. If it doesn't support them, the "#if > __GNUC_PREREQ (2, 7)" would need to change to disallow ICC, or else a new > implementation approach would need to be added. If it does support them, > then we get into ensuring the other macros regarding supported types are > defined appropriately for the ICC case. We just found that Ubuntu's modified glibc header file caused the problem. In the (latest) glibc sources the following line does not exist && !defined(__CUDACC__) && !defined(__ICC) so the code in glibc's header file looks like this: #if (defined __x86_64__ \ ? __GNUC_PREREQ (4, 3)\ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) # define __HAVE_FLOAT128 1 #else # define __HAVE_FLOAT128 0 #endif Since the unmodified header file works with ICC, please report this bug to Ubuntu. |