From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8E063858406; Tue, 26 Apr 2022 06:48:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8E063858406 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/105376] ICE: in decimal_to_decnumber, at dfp.cc:134 with _Decimal128 at -O -g Date: Tue, 26 Apr 2022 06:48:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2022 06:48:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105376 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org, | |rguenth at gcc dot gnu.org --- Comment #2 from Richard Biener --- (gdb) p debug_rtx (rtl) (const_double:TD -2.0e+0 [-0x0.8p+2]) but CONST_DOUBLE_REAL_VALUE (rtl) has ->recimal =3D=3D false, and that's tr= ue even on the tree level. Generated by /* Convert x+x into x*2. */ (simplify (plus @0 @0) (if (SCALAR_FLOAT_TYPE_P (type)) (mult @0 { build_real (type, dconst2); }) (if (INTEGRAL_TYPE_P (type)) (mult @0 { build_int_cst (type, 2); })))) where indeed the dconst2 is not decimal. I have no idea how to create a DFP constant, but I guess that in priciple (at least for dconst2), creating the constant with double_type_node and then fold-converting to type might w= ork? It just looks like a bit much of work ... Joseph, do you have any insights here? The above is of course copied from fold-const.cc originally.=