From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A2433858404; Mon, 13 Feb 2023 20:58:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A2433858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676321936; bh=BSX+66zPM1LMb4mkN9jPBapox0qnu4ERhNbA8bgexVQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fSxuXCZJldb12Ms7n+ZQzsXNhkRdbGg+B9IY2GT6yvwDGAJkNI3gjEgoW2stzuX+w luKtiBjxDXN92zqy7B6EtxNWjt1YJ9ePMDaMxqrZ4x2IXD4KORLtoQ/DXjrj2b899O AoudmbULHML8cDbI2P25diWScYDMhTOrw0p1p1kc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108757] We do not simplify (a - (N*M)) / N + M -> a / N Date: Mon, 13 Feb 2023 20:58:56 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: component 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=3D108757 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |tree-optimization --- Comment #17 from Andrew Pinski --- _13 =3D rows_8(D) + 18446744073709551612; _15 =3D _13 >> 2; doloop.8_5 =3D _15 + 1; This is what IV-OPTS produces. Reduced testcase: typedef __SIZE_TYPE__ size_t; void convert(size_t rows, float*src, float *result) { for(size_t i =3D 0; i + 4 <=3D rows; i+=3D4) { float t =3D src[i]; result[i] =3D t; } }=