Bug 84654 - libstdc++ tries to use __float128 when compiling with -mno-float128
Summary: libstdc++ tries to use __float128 when compiling with -mno-float128
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 8.0.1
: P3 normal
Target Milestone: 7.4
Assignee: Tulio Magno Quites Machado Filho
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-03-01 18:25 UTC by Tulio Magno Quites Machado Filho
Modified: 2018-08-07 22:56 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-03-01 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tulio Magno Quites Machado Filho 2018-03-01 18:25:09 UTC
Using the following test program:

$ cat test1.cpp 
#include <math.h>
int main() {
    return 0;
}

$ g++-8 -mno-float128 test.cpp 
In file included from /usr/include/c++/8/cmath:47,
                 from /usr/include/c++/8/math.h:36,
                 from test.cpp:1:
/usr/include/c++/8/bits/std_abs.h:101:3: error: ‘__float128’ does not name a type; did you mean ‘__floorl’?
   __float128
   ^~~~~~~~~~
   __floorl

I reproduced this problem on powerpc64le.

I have a patch to fix this.
Comment 1 Segher Boessenkool 2018-03-01 18:51:20 UTC
Tulio will handle this.
Comment 2 Jonathan Wakely 2018-03-26 15:27:18 UTC
Fix posted to:
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01389.html
Comment 3 Jonathan Wakely 2018-05-01 22:48:05 UTC
Author: redi
Date: Tue May  1 22:47:33 2018
New Revision: 259813

URL: https://gcc.gnu.org/viewcvs?rev=259813&root=gcc&view=rev
Log:
PR libstdc++/84654 Disable __float128 specializations for -mno-float128

2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	PR libstdc++/84654
	* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
	* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
	* configure: Regenerate.
	* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
	based on ENABLE_FLOAT128.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
	[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
	_GLIBCXX_USE_FLOAT128.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/acinclude.m4
    trunk/libstdc++-v3/config.h.in
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/include/Makefile.am
    trunk/libstdc++-v3/include/Makefile.in
    trunk/libstdc++-v3/include/bits/c++config
Comment 4 Jonathan Wakely 2018-05-02 09:44:54 UTC
Fixed for GCC 9.

This might be suitable to backport to release branches after some soak time on the trunk.
Comment 5 Jonathan Wakely 2018-07-31 09:39:01 UTC
Author: redi
Date: Tue Jul 31 09:38:28 2018
New Revision: 263084

URL: https://gcc.gnu.org/viewcvs?rev=263084&root=gcc&view=rev
Log:
PR libstdc++/84654 Disable __float128 specializations for -mno-float128

Backport from mainline
2018-05-08  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85672
	* include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry
	to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition
	within conditional block.

Backport from mainline
2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	PR libstdc++/84654
	* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
	* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
	* configure: Regenerate.
	* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
	based on ENABLE_FLOAT128.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
	[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
	_GLIBCXX_USE_FLOAT128.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/acinclude.m4
    branches/gcc-8-branch/libstdc++-v3/config.h.in
    branches/gcc-8-branch/libstdc++-v3/configure
    branches/gcc-8-branch/libstdc++-v3/include/Makefile.am
    branches/gcc-8-branch/libstdc++-v3/include/Makefile.in
    branches/gcc-8-branch/libstdc++-v3/include/bits/c++config
Comment 6 Jonathan Wakely 2018-07-31 09:40:42 UTC
Backported to gcc-8-branch for 8.3
Comment 7 Jonathan Wakely 2018-08-07 22:51:22 UTC
Author: redi
Date: Tue Aug  7 22:50:49 2018
New Revision: 263382

URL: https://gcc.gnu.org/viewcvs?rev=263382&root=gcc&view=rev
Log:
PR libstdc++/84654 Disable __float128 specializations for -mno-float128

Backport from mainline
2018-05-08  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85672
	* include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry
	to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition
	within conditional block.

Backport from mainline
2018-05-01  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	PR libstdc++/84654
	* acinclude.m4: Set ENABLE_FLOAT128 instead of _GLIBCXX_USE_FLOAT128.
	* config.h.in: Remove references to _GLIBCXX_USE_FLOAT128.
	* configure: Regenerate.
	* include/Makefile.am: Replace the value of _GLIBCXX_USE_FLOAT128
	based on ENABLE_FLOAT128.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Define _GLIBCXX_USE_FLOAT128.
	[!defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)]: Undefine
	_GLIBCXX_USE_FLOAT128.

Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/acinclude.m4
    branches/gcc-7-branch/libstdc++-v3/config.h.in
    branches/gcc-7-branch/libstdc++-v3/configure
    branches/gcc-7-branch/libstdc++-v3/include/Makefile.am
    branches/gcc-7-branch/libstdc++-v3/include/Makefile.in
    branches/gcc-7-branch/libstdc++-v3/include/bits/c++config
Comment 8 Jonathan Wakely 2018-08-07 22:56:20 UTC
Backported to gcc-7-branch for 7.4