From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 67A79385B515; Fri, 1 Dec 2023 08:04:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67A79385B515 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701417898; bh=4XsGh8WAKISe+5SRJwGpNgxg7E+mjbk477fDEssXaDE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UBVzYaPmK0JBENZ30xJKWP3V8VMWFQyIyBgRKROsVkcOm0E5Sq8KrvVHI/xlohbBp kRoqG+b4HPaP33eoXmHzulv6dkUiNBVfraLr7/t0njhrxKcmYFfkKqRXoJhLKddUOZ H8uei8WBDjoIrBmknIYBJun3co1Rhvh7g+gkQCmM= From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112788] [14 regression] ICEs in fold_range, at range-op.cc:206 after r14-5972-gea19de921b01a6 Date: Fri, 01 Dec 2023 08:04:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cc cf_reconfirmed_on 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112788 Kewen Lin changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |linkw at gcc dot gnu.org, | |meissner at gcc dot gnu.or= g, | |segher at gcc dot gnu.org Last reconfirmed| |2023-12-01 --- Comment #1 from Kewen Lin --- Confirmed. A reduced test case: long double a, b, c; long double d() { return -__builtin_fmaf128_round_to_odd(c, b, a); } c.0_1 =3D c; b.1_2 =3D b; a.2_3 =3D a; _4 =3D __builtin_fmaf128_round_to_odd (c.0_1, b.1_2, a.2_3); _6 =3D -_4; return _6; 206=E2=94=9C=E2=94=80=E2=94=80=E2=94=80> gcc_assert (m_operator->operand_c= heck_p (type, lh.type (), rh.type ())); stmt: _6 =3D -_4; (gdb) pge lh.type() _Float128 (gdb) pge rh.type() long double The root cause is the same to what's in PR107299, TYPE_PRECISION of rh.type= is 127 while that of lh.type is 128, some attempts were tried to fix this precision difference before but failed to, like: https://inbox.sourceware.org/gcc-patches/718677e7-614d-7977-312d-05a75e1fd5= b4@linux.ibm.com/. ranger makes use of type precision directly instead of something like types_compatible_p. I wonder if we can introduce a target hook (or hookpod)= to make ranger unrestrict this check a bit, the justification is that for float type its precision information is encoded in its underlying real_format, if= two float types underlying modes are the same, the precision are actually the s= ame.=20 btw, the operand_check_ps seems able to call range_compatible_p?=