[Bug] A simple code including tgmath.h cannot be compiled with icc with Ubuntu 20.04 OS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Balint Reczey | ||
Groovy |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
[Impact]
A simple code including tgmath.h cannot be compiled with icc with Ubuntu 20.04 OS and later releases.
[Test Case]
icc:
Compile the following code with Intel compiler (icc) by running “icc -c test.c”
$ cat test.c
#include <tgmath.h>
There should not be any compilation error
[Where problems could occur]
The fix is dropping compile time check preventing using float128 with icc. In case of a mistake using float128 becomes prevented in other compilers as well, but this is highly unlikely, since the vanilla upstream code is known to work.
Older icc compilers (for which the patch has been introduced) will stop compiling code with the _fixed_ tgmath.h because of LP: #1717257.
Users can still install older icc compilers from 3rd party sources, but there is no good way of avoiding that. They can still override the packaged tgmath.h.
[Original Bug Text]
[Summary]: A simple code including tgmath.h cannot be compiled with icc with Ubuntu 20.04 OS
[Ubuntu OS version]: 20.04
[Reproduce Steps]: Compile the following code with Intel compiler (icc) by running “icc -c test.c”
$ cat test.c
#include <tgmath.h>
[Results]
Expected: There should not be any compilation error
Actual: The following error is produced:
$ icc -c test.c
In file included from /localdisk2/
/usr/include/
# error "Unsupported combination of types for <tgmath.h>."
^
compilation aborted for test.c (code 2)
[Additional Information on Test setup]:
ICC compiler supports the __float128 type if the reference compiler is more recent than GNU version 4.4. Therefore, __HAVE_FLOAT128 should be set to 1 when ICC compiler is used with GNU version higher than 4.4. Based on this, I believe that the red part below in floatn.h, which comes with Ubuntu OS, should be updated/removed.
#if (defined __x86_64__ \
? __GNUC_PREREQ (4, 3) \
: (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
&& !defined(
# define __HAVE_FLOAT128 1
#else
# define __HAVE_FLOAT128 0
#endif
Currently, when the tgmath.h system header file is included on Ubuntu 20.04 OS system, __HAVE_FLOAT128 is set to zero and __HAVE_FLOAT64X set to 1 for ICC. And this is not a supported combination as checked in the new tgmath.h system header file:
# if ((__HAVE_FLOAT64X && !__HAVE_FLOAT128) \
|| (__HAVE_FLOAT128 && !__HAVE_FLOAT64X))
# error "Unsupported combination of types for <tgmath.h>."
# endif
Upstream bug: Not known
=======
summary: |
- [Bug[ A simple code including tgmath.h cannot be compiled with icc with + [Bug] A simple code including tgmath.h cannot be compiled with icc with Ubuntu 20.04 OS |
tags: | added: rls-ff-incoming |
tags: | removed: rls-ff-incoming |
tags: | added: fr-900 |
description: | updated |
Changed in glibc (Ubuntu Focal): | |
status: | New → In Progress |
Changed in glibc (Ubuntu Groovy): | |
status: | New → In Progress |
Changed in glibc (Ubuntu Focal): | |
assignee: | nobody → Balint Reczey (rbalint) |
Changed in glibc (Ubuntu Groovy): | |
assignee: | nobody → Balint Reczey (rbalint) |
tags: | added: block-proposed-groovy |
affects: | intel → ubuntu-translations |
no longer affects: | ubuntu-translations |
Changed in glibc (Ubuntu Groovy): | |
assignee: | Balint Reczey (rbalint) → nobody |
groovy-proposed has 2.32 https:/ /launchpad. net/ubuntu/ +source/ glibc/2. 32-0ubuntu2 can this issue be reproduced there?
Do you have glibc upstream commit id on master and/or stable branches with fix for this?