From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 400903858031; Sun, 8 Oct 2023 03:03:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 400903858031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696734215; bh=imddRJo2OolSUX2aulAHxTKJSqVkeKgCPGtpzDd5zm8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h8J5QPJqPZFtacgBBsQedW57WFQ0tjcoWseiGQ51KSZqsnV1Nrwv9ExUfSK3L023Y YbGfEt1YNoZGwza7MshIQe7hJtuSdCVlElKFwQzz53vowOdbh3l6c7d75IVXOey3rA ghL2GMkAvDb4s4aVRPFPh+h3sGW2CUOzRCejAR7A= From: "652023330028 at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111718] Missed optimization of '(a+a)/a' Date: Sun, 08 Oct 2023 03:03:34 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: 652023330028 at smail dot nju.edu.cn X-Bugzilla-Status: UNCONFIRMED 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: 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=3D111718 --- Comment #2 from Yi <652023330028 at smail dot nju.edu.cn> --- We noticed one change between gcc-13.2 and the current gcc-trunk: https://godbolt.org/z/j5Mnvno9n In the following code, gcc-13.2 does not yet have the ability to optimize as expected, but on gcc-trunk, it does. unsigned n1,n2; void func1(unsigned a){ if(a<=3D10 || a>=3D20) return; n2=3D(a+a)/a; } Maybe this change will help solve this issue?=