From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6658A3858406; Fri, 12 Nov 2021 07:35:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6658A3858406 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/103193] gcc for x86_64: wrong code generation: ucomiss instead of comiss Date: Fri, 12 Nov 2021 07:35:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: wrong-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: cf_gcctarget component everconfirmed cc bug_status 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 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: Fri, 12 Nov 2021 07:35:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103193 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86_64-*-* i?86-*-* Component|target |middle-end Ever confirmed|0 |1 CC| |rguenth at gcc dot gnu.org Status|UNCONFIRMED |NEW Last reconfirmed| |2021-11-12 --- Comment #4 from Richard Biener --- (In reply to joseph@codesourcery.com from comment #3) > Converting from >=3D to =3D=3D is inappropriate (because >=3D should rais= e invalid=20 > for all NaN operands but =3D=3D should do so only for signaling NaNs). I= f=20 > that's happening in architecture-independent code, then this is an=20 > architecture-independent bug. /* Simplify comparison of something with itself. For IEEE floating-point, we can only do some of these simplifications. */ (for cmp (eq ge le) (simplify (cmp @0 @0) (if (! FLOAT_TYPE_P (TREE_TYPE (@0)) || ! HONOR_NANS (@0)) { constant_boolean_node (true, type); } (if (cmp !=3D EQ_EXPR) (eq @0 @0))))) does this. The folding to =3D=3D happens unconditionally. As I understand= you the condition that applies to the constant folding should apply to the folding to EQ as well, which means we effectively need to remove the canonicalization to EQ (since when it would be valid we can fold to constant true)? There are similar transforms following: (for cmp (unle unge uneq) (simplify (cmp @0 @0) { constant_boolean_node (true, type); })) (for cmp (unlt ungt) (simplify (cmp @0 @0) (unordered @0 @0))) (simplify (ltgt @0 @0) (if (!flag_trapping_math) { constant_boolean_node (false, type); }))=