From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1774D385702C; Wed, 28 Sep 2022 10:05:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1774D385702C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664359546; bh=POGAHASE3OEdITfK8jhE/xhV22JwAhgswCRG1/OWLF8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AekvVrepA+chkJMP16kryhQw/BRoVNIMbKtv++ZRXzb/ei/M4ud/cF5IicFJAEpSq w/vsttYw5ssvw4T891P1yMgbpAmm5lLykqCQ9F1nDXSy/EBHdMvKjWvkVh510aB6u7 QIfN5/DLjRCqsFwuVh15JO3fccgHCSbi/6P5Kcu8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105414] constant folding for fmin/max(snan, snan) is wrong Date: Wed, 28 Sep 2022 10:05:44 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: guihaoc 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=3D105414 --- Comment #13 from CVS Commits --- The master branch has been updated by Xi Ruoyao : https://gcc.gnu.org/g:b48d7ff3570fa0ebe7790275cf020d8885120338 commit r13-2914-gb48d7ff3570fa0ebe7790275cf020d8885120338 Author: Xi Ruoyao Date: Sat Sep 24 20:47:22 2022 +0800 LoongArch: Use UNSPEC for fmin/fmax RTL pattern [PR105414] I made a mistake defining fmin/fmax RTL patterns in r13-2085: I used smin and smax in the definition mistakenly. This causes the optimizer to perform constant folding as if fmin/fmax was "really" smin/smax operations even with -fsignaling-nans. Then pr105414.c fails. We don't have fmin/fmax RTL codes for now (PR107013) so we can only use an UNSPEC for fmin and fmax patterns. gcc/ChangeLog: PR tree-optimization/105414 * config/loongarch/loongarch.md (UNSPEC_FMAX): New unspec. (UNSPEC_FMIN): Likewise. (fmax3): Use UNSPEC_FMAX instead of smax. (fmin3): Use UNSPEC_FMIN instead of smin.=