From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5AE093858284; Wed, 24 Aug 2022 20:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AE093858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661373947; bh=mYFL1eDsPzCedj4wamTiaHl/fPYYsgr/oXo3wIayZWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nHoJZ/bTgwisqWSGXsQ/Gb++6BdJrkznj5yPOQ4qluf+ob5N4zA/dJ27OAddiJR2l 8PneeHw15B9alXzed0ZjpWm04m89pk/GssPKsdG8+fcOKk53WEwXDC+zQNYo4rT1Lv Mq91BKA0/vZV+WNuXpSzoqfQIrwS3gSH9eDK7pTo= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100736] ICE: unrecognizable insn Date: Wed, 24 Aug 2022 20:45:46 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: segher 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: 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=3D100736 --- Comment #6 from Segher Boessenkool --- There are so many things here, it's hard to start. Two big things: Firstly, this is not floating point at all, so -ffinite-math-only should not make any difference. We currently abuse CCFP (in a non-safe way), this sho= uld be fixed. Secondly, -mcpu=3Dpower9 (to get isel) or -mcpu=3Dpower10 (to get setbc) ar= e more interesting. What is the generated machine code for those? More things: crnot is needed to get the polarity of the result correct. We could instead do a xori 1 (or similar) on the eventual GPR. If we do say a cror and a cr= not we should make this can be combined to a crnor (all 14 logic functions are supported), but if the inversion is done in the GPR (with such a xori, say), this is much harder to optimise. If we are not interested in overflows, always one of LT GT EQ is set, so we never need any crlogical insn here. To be exact, this is whenever we have valid inputs: if there is output overflow cr6.3 will be set as well, but still exactly one of cr6.0, cr6.1, cr6.2 will be set. But if there is an invalid *input* cr6 is set to 0b0001 always. I don't th= ink we need to care here (otoh it isn't obvious how to best model it!)=