Summary: | [8 Regression] powerpc64le _Float128 ICE in as_a, at machmode.h:345 | ||
---|---|---|---|
Product: | gcc | Reporter: | Joseph S. Myers <jsm28> |
Component: | middle-end | Assignee: | Michael Meissner <meissner> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amodra, bill.schmidt, meissner, segher |
Priority: | P3 | ||
Version: | 8.0 | ||
Target Milestone: | 8.0 | ||
Host: | Target: | powerpc64le-linux-gnu | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2017-10-27 00:00:00 |
Description
Joseph S. Myers
2017-09-26 22:02:18 UTC
This occurs because both fld and ff128 return the same constant (0), one using it as a long double and the other as a _Float128. Having a 0 constant is not important. If we return 1 in both functions, it will still trap. If we change the constant so each function (fld and ff128) returns a different value, it works. If we suppress inlining, it works. Author: meissner Date: Thu Nov 9 20:01:29 2017 New Revision: 254607 URL: https://gcc.gnu.org/viewcvs?rev=254607&root=gcc&view=rev Log: fix pr 82333 Added: branches/ibm/ieee/gcc/testsuite/gcc.target/powerpc/pr82333.c Modified: branches/ibm/ieee/gcc/ChangeLog.meissner branches/ibm/ieee/gcc/builtins.c branches/ibm/ieee/gcc/builtins.def branches/ibm/ieee/gcc/c/c-decl.c branches/ibm/ieee/gcc/config/rs6000/rs6000.md branches/ibm/ieee/gcc/convert.c branches/ibm/ieee/gcc/fold-const-call.c branches/ibm/ieee/gcc/fold-const.c branches/ibm/ieee/gcc/internal-fn.def branches/ibm/ieee/gcc/testsuite/ChangeLog.meissner branches/ibm/ieee/gcc/testsuite/gcc.target/powerpc/float128-hw2.c branches/ibm/ieee/gcc/varasm.c The bug is due to compare_constant thinking two floating point constants are the same if the floating point size and the internal value are the same. On the PowerPC, long double and _Float128 both are 128-bits, but they have different internal representations. The bug shows up when you try to inline two functions, one that returns 0 converted to long double _Complex and the other that returns 0 converted to _Float128 _Complex. The function compare_constant in varasm.c thinks that these two constants are the same, and assigns them to the same hash. When inliner tries to replace the inline function (that returns 0) with the constant, it does moves of the real part and the imaginary part. In the second function, the real/imaginary parts have type KFmode, while the first function (that has the saved constant) the real/imaginary parts have type TFmode. The fix is to consider the type along with the precision when doing hash of the constants. Note the checkin message in note 2 was for a private branch, that included other patches that have been submitted. *** Bug 82928 has been marked as a duplicate of this bug. *** Fixed in subversion id 255177. |