As e.g. decimal_from_decnumber shows, the REAL_VALUE_TYPE representation contains a decimal128 embedded in ->sig only if it is rvc_normal, for other kinds like rvc_inf or rvc_nan, ->sig is ignored and everything is contained in the REAL_VALUE_TYPE flags (cl, sign, signalling and decimal). decimal_to_binary which is used when folding a decimal{32,64,128} constant to a binary floating point type ignores this and thus folds infinities and NaNs into +0.0. The following patch fixes that by only doing that for rvc_normal. Similarly to the binary to decimal folding, it goes through a string, in order to e.g. deal with canonical NaN mantissas, or binary float formats that don't support infinities and/or NaNs. 2020-03-11 Jakub Jelinek <jakub@redhat.com> PR middle-end/94111 * dfp.c (decimal_to_binary): Only use decimal128ToString if from->cl is rvc_normal, otherwise use real_to_decimal to print the number to string. * gcc.dg/dfp/pr94111.c: New test.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ada | Loading commit data... | |
brig.dg | Loading commit data... | |
c-c++-common | Loading commit data... | |
config | Loading commit data... | |
g++.dg | Loading commit data... | |
g++.old-deja | Loading commit data... | |
g++.target | Loading commit data... | |
gcc.c-torture | Loading commit data... | |
gcc.dg | Loading commit data... | |
gcc.dg-selftests | Loading commit data... | |
gcc.misc-tests | Loading commit data... | |
gcc.src | Loading commit data... | |
gcc.target | Loading commit data... | |
gcc.test-framework | Loading commit data... | |
gdc.dg | Loading commit data... | |
gdc.test | Loading commit data... | |
gfortran.dg | Loading commit data... | |
gfortran.fortran-torture | Loading commit data... | |
gnat.dg | Loading commit data... | |
go.dg | Loading commit data... | |
go.go-torture/execute | Loading commit data... | |
go.test | Loading commit data... | |
jit.dg | Loading commit data... | |
lib | Loading commit data... | |
obj-c++.dg | Loading commit data... | |
objc | Loading commit data... | |
objc-obj-c++-shared | Loading commit data... | |
objc.dg | Loading commit data... | |
selftests | Loading commit data... | |
.gitattributes | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog-1993-2007 | Loading commit data... | |
ChangeLog-2008 | Loading commit data... | |
ChangeLog-2009 | Loading commit data... | |
ChangeLog-2010 | Loading commit data... | |
ChangeLog-2011 | Loading commit data... | |
ChangeLog-2012 | Loading commit data... | |
ChangeLog-2013 | Loading commit data... | |
ChangeLog-2014 | Loading commit data... | |
ChangeLog-2015 | Loading commit data... | |
ChangeLog-2016 | Loading commit data... | |
ChangeLog-2017 | Loading commit data... | |
ChangeLog-2018 | Loading commit data... | |
ChangeLog-2019 | Loading commit data... | |
ChangeLog.graphite | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.ptr | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
README | Loading commit data... | |
README.compat | Loading commit data... | |
README.gcc | Loading commit data... |