From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AF87386F43F; Wed, 22 Apr 2020 06:23:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AF87386F43F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587536582; bh=5Lk+KXeGHoQRUdS7mnjNnS0R0qk/AAroNo2TMkGxjCo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lzf4kJHtyWZqsjxLPuYKeNAijk+TsoIy2rGoUetjLOjd2XpRZuMGI6wM+M1oj6JHt WCBoSzpSYzuAavBGcsmfclKFxyGOdMPkkMl8w7Y69tlO5ira7or4XsnKnLKzSbsO2y zuq6ePI2XP7e3dIuNSp5YaGNOiEoBNV40UJkC7Mc= From: "z.zhanghaijian at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94665] missed minmax optimization opportunity for if/else structure. Date: Wed, 22 Apr 2020 06:23:02 +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: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: z.zhanghaijian at huawei dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: segher 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 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: Wed, 22 Apr 2020 06:23:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94665 --- Comment #16 from z.zhanghaijian at huawei dot com --- (In reply to Segher Boessenkool from comment #15) > replacing flag_unsafe_math_operations by flag_finite_math_only isn't corr= ect, > but you can add it instead, i.e. >=20 > - if ((! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations) > + if (!FLOAT_MODE_P (mode) > + || (flag_unsafe_math_optimizations && flag_finite_math_only)) >=20 > or such? >=20 > Thanks for working on a patch! Ok, I will create a new PR to track this bug, and I will submit a bugfix pa= tch whit that PR. In addition, I tracked the process of generating fmaxnm/fminnm and found th= at it was generated in phiopt (minmax_replacement) and if-conversion (noce_try_minmax). In the rtl combine, only fminnm can be generated. Is it necessary for us to improve this optimization in the rtl combine using the above patch in stage1?=