From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3AE9638558B9; Tue, 30 May 2023 15:44:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AE9638558B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685461472; bh=zkDJcEQbzZ7SIEdn6XPCdprDay5ELqIttH/BY86pT+0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=saGY04j3b42q6g5bdvRs24e/2t5Za3tQlI8mpF6sHQT1KbFD0NHsgYFe+G0B7lpsW 17gzdnt7v4zkFFgU5fVaCPm3Tg77EKtyPJVmX53hYaVK88mY61cdQVuJaPZvADD7xJ HyoN7rFuFnrPIscL9OtjvBoYa8oj0yoko/5lfWTg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/87913] max(n, 1) code generation Date: Tue, 30 May 2023 15:44:31 +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: 8.2.0 X-Bugzilla-Keywords: missed-optimization 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: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.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=3D87913 --- Comment #7 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:45466eecf5ef669164c0922e5be8fd288b144886 commit r14-1412-g45466eecf5ef669164c0922e5be8fd288b144886 Author: Andrew Pinski Date: Tue May 16 14:26:41 2023 -0700 Add a !=3D MIN/MAX_VALUE_CST ? CST-+1 : a to minmax_from_comparison This patch adds the support for match that was implemented for PR 87913= in phiopt. It implements it by adding support to minmax_from_comparison for the ch= eck. It uses the range information if available which allows to produce MIN/= MAX expression when comparing against the lower/upper bound of the range instead of lower/upper of the type. minmax-20.c is the new testcase which tests the ranges part. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * fold-const.cc (minmax_from_comparison): Add support for NE_EX= PR. * match.pd ((cond (cmp (convert1? x) c1) (convert2? x) c2) pattern): Add ne as a possible cmp. ((a CMP b) ? minmax : minmax pattern): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/minmax-22.c: New test.=