From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0C3B3848011; Thu, 18 Mar 2021 18:11:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0C3B3848011 From: "acsawdey at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/97926] ICE in patch_jump_insn, at cfgrtl.c:1298 Date: Thu, 18 Mar 2021 18:11:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: acsawdey at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: acsawdey at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Thu, 18 Mar 2021 18:11:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97926 --- Comment #3 from acsawdey at gcc dot gnu.org --- So the underlying problem here is that the unordered comparisons are not allowed with -ffinite-math-only due to this predicate: ;; Return 1 if OP is a comparison operation that is valid for a branch ;; instruction. We check the opcode against the mode of the CC value. ;; validate_condition_mode is an assertion. (define_predicate "branch_comparison_operator" (and (match_operand 0 "comparison_operator") (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) =3D=3D MODE_C= C") (if_then_else (match_test "GET_MODE (XEXP (op, 0)) =3D=3D CCFPmode") (if_then_else (match_test "flag_finite_math_only") (match_code "lt,le,gt,ge,eq,ne,unordered,ordered") (match_code "lt,gt,eq,unordered,unge,unle,ne,ordered")) (match_code "lt,ltu,le,leu,gt,gtu,ge,geu,eq,ne")) (match_test "validate_condition_mode (GET_CODE (op), GET_MODE (XEXP (op, 0))), 1"))) But ubsan_instrument_float_cast() generates this: t =3D fold_build2 (UNLE_EXPR, boolean_type_node, expr, min); tt =3D fold_build2 (UNGE_EXPR, boolean_type_node, expr, max); which eventually leads to the ICE. Even if this branch wasn't rewritten by patch_dump_insn() it would not be recognized and would eventually ICE. Segher is working on a change to that predicate for PR98092 though which ma= y be a workaround fix for this.=