From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 254353858D35; Mon, 13 Nov 2023 08:44:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 254353858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699865052; bh=8eMJq8rZ4c1qRIkisrX8xqUvlXIEcuoLJl0LgUZRuIs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kLpm0/iSXy7uwxAeIbvB08XPToV0qusIMRYlOWD9Ws6jWPEMoEhWflIMAfQRJN6An bJ8t8Xjkxwy5+Af55aYL2MmGX/BYuPqWI8EpYPTccg0jI0M4Grq2eQq6S0knOptcKt k1jcsJLLqwJjCCdiGw1KD4H615XFw81UAjFkKCKA= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/112483] [14 Regression] gfortran.dg/ieee/ieee_2.f90 fails on loongarch64-linux-gnu at -O1 or above Date: Mon, 13 Nov 2023 08:44:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, testsuite-fail, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112483 --- Comment #17 from Xi Ruoyao --- (In reply to Xi Ruoyao from comment #16) > (In reply to Andrew Pinski from comment #12) > > What about this patch: > > ``` > > diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc > > index 69d87579d9c..f3745d86aea 100644 > > --- a/gcc/simplify-rtx.cc > > +++ b/gcc/simplify-rtx.cc > > @@ -4392,7 +4392,7 @@ simplify_ashift: > > real_convert (&f1, mode, CONST_DOUBLE_REAL_VALUE (trueop1)); > > rtx tmp =3D simplify_gen_unary (ABS, mode, op0, mode); > > if (REAL_VALUE_NEGATIVE (f1)) > > - tmp =3D simplify_gen_unary (NEG, mode, op0, mode); > > + tmp =3D simplify_unary_operation (NEG, mode, tmp, mode); > > return tmp; > > } > > if (GET_CODE (op0) =3D=3D NEG || GET_CODE (op0) =3D=3D ABS) > >=20 > > ``` > >=20 > > We only generate NEG if it simplifies from the ABS. Most likely due to > > constants. >=20 > I'm trying this out on LoongArch. Works for me. Will you send the simplify_gen_unary -> simplify_unary_opera= tion change to gcc-patches?=