middle-end/105376 - invalid REAL_CST for DFP constant
authorRichard Biener <rguenther@suse.de>
Wed, 27 Apr 2022 06:28:31 +0000 (08:28 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 6 May 2022 10:29:48 +0000 (12:29 +0200)
commit39c56695c70a2052fc6bdcfca606dfff9c2fa975
treee34c408f2354ddc386ce9bd2ec70dcf56d8b842b
parente8cd7d0066e0ba2a082b0e7de35e883837546583
middle-end/105376 - invalid REAL_CST for DFP constant

We are eventually ICEing in decimal_to_decnumber on non-decimal
REAL_VALUE_TYPE that creep in from uses of build_real (..., dconst*)
for DFP types.  The following extends the decimal_to_decnumber
special-casing of dconst* to build_real, avoiding the bogus REAL_CSTs
from creeping into the IL and modified to ones not handled by
the decimal_to_decnumber special casing.  It also makes sure to
ICE for not handled dconst* values at the point we build the REAL_CST.

2022-04-27  Richard Biener  <rguenther@suse.de>

PR middle-end/105376
* tree.cc (build_real): Special case dconst* arguments
for decimal floating point types.

* gcc.dg/pr105376.c: New testcase.

(cherry picked from commit e27eef7478f30ea79048dbde3317e89679d75a6e)
gcc/testsuite/gcc.dg/pr105376.c [new file with mode: 0644]
gcc/tree.cc