Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1538817 - g++ fails to compile libcxx on ppc64: error: ‘(9.223372036854775807e+18 / 1.0e+9)’ is not a constant expression
Summary: g++ fails to compile libcxx on ppc64: error: ‘(9.223372036854775807e+18 / 1.0...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 30
Hardware: ppc64le
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2018-01-25 21:54 UTC by Tom Stellard
Modified: 2020-01-16 03:12 UTC (History)
15 users (show)

Fixed In Version: gcc-9.2.1-1.fc32.3
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-16 02:25:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Preprocesed C++ File (1.06 MB, text/plain)
2018-01-25 21:54 UTC, Tom Stellard
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 88204 0 P3 RESOLVED New test case 26_numerics/complex/operators/more_constexpr.cc from r266416 fails 2020-02-10 18:00:01 UTC
IBM Linux Technology Center 173350 0 None None None 2019-06-18 13:27:04 UTC

Description Tom Stellard 2018-01-25 21:54:17 UTC
Created attachment 1386322 [details]
Preprocesed C++ File

Description of problem:
The attached reprocessed c++ file fails to compile on ppc64 and ppc64le, but it does compile successfully on x86_64.


Version-Release number of selected component (if applicable):
gcc-7.2.1-2.fc27

How reproducible:
Always


Steps to Reproduce:
1. c++ condition_variable.i


Actual results:
In file included from /root/libcxx/include/__mutex_base:15:0,
                 from /root/libcxx/include/condition_variable:111,
                 from ../src/condition_variable.cpp:14:
/root/libcxx/include/chrono: In function ‘void std::__1::this_thread::sleep_for(const std::__1::chrono::duration<_Rep, _Period>&)’:
/root/libcxx/include/thread:438:65:   in constexpr expansion of ‘std::__1::chrono::duration<long double>(std::__1::chrono::duration<long long int, std::__1::ratio<1, 1000000000> >::max(), 0)’
/root/libcxx/include/chrono:563:67:   in constexpr expansion of ‘std::__1::chrono::duration_cast<std::__1::chrono::duration<long double>, long long int, std::__1::ratio<1, 1000000000> >(__d)’
/root/libcxx/include/chrono:415:67:   in constexpr expansion of ‘std::__1::chrono::__duration_cast<std::__1::chrono::duration<long long int, std::__1::ratio<1, 1000000000> >, std::__1::chrono::duration<long double>, std::__1::ratio<1, 1000000000>, true, false>().std::__1::chrono::__duration_cast<std::__1::chrono::duration<long long int, std::__1::ratio<1, 1000000000> >, std::__1::chrono::duration<long double>, std::__1::ratio<1, 1000000000>, true, false>::operator()(__fd)’
/root/libcxx/include/chrono:376:59: error: ‘(9.223372036854775807e+18 / 1.0e+9)’ is not a constant expression
                            static_cast<_Ct>(__fd.count()) / static_cast<_Ct>(_Period::den)));
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Expected results:
File compiles successfully.

Comment 1 Jakub Jelinek 2018-01-26 20:38:13 UTC
The IBM long double format is too weird and not everything in it is possible to be evaluated at compile time.

Comment 2 Tom Stellard 2018-01-26 20:41:00 UTC
So is my best option to  modify the source to not use constexpr on ppc?

Comment 3 Tom Stellard 2018-01-26 20:41:49 UTC
I also should have mentioned that this compiles fine with clang.

Comment 4 dxm480 2018-07-30 10:22:51 UTC
@Jakub - what about (9.223372036854775807e+18 / 1.0e+9) is not possible to evaluate at compile time in IBM long double format? I agree that it's an abomination but the unfortunate reality is there will be systems out there with IBM long-double ABI libraries for decades to come. :(

@Tom: one potential workaround is to use IEEE754 standard long double format, e.g. build with "-mabi=ieeelongdouble", but now you're using a different ABI, which may or may not be what you want. It is probably easier to just avoid using constexpr when building with the GCC+PPC combination.

Comment 5 Dan Horák 2018-09-05 21:29:51 UTC
same problem with gcc-8.1.1-5.fc28.ppc64le

Comment 6 Bill Schmidt 2018-09-12 20:31:02 UTC
(In reply to Tom Stellard from comment #2)
> So is my best option to  modify the source to not use constexpr on ppc?

Yes.

Bill Schmidt, Ph.D.
GCC Architect for Linux on Power
IBM Linux Technology Center
wschmidt.com

Comment 7 Jeffrey Walton 2018-11-17 01:17:50 UTC
Also see https://bugs.llvm.org/show_bug.cgi?id=39696 . This issue blocks LLVM from building on GCC112 on the compile farm.

(There may be additional build problems).

Comment 8 Ben Cotton 2018-11-27 13:32:30 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2018-11-30 23:39:00 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Ben Cotton 2019-02-19 17:12:14 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30.

Comment 11 Tom Stellard 2020-01-16 02:25:05 UTC
This is working now with gcc-9.2.1-1.fc32.3.

Comment 12 Jeffrey Walton 2020-01-16 03:12:07 UTC
(In reply to Tom Stellard from comment #11)
> This is working now with gcc-9.2.1-1.fc32.3.

Thanks Tom.


Note You need to log in before you can comment on or make changes to this bug.