From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A7E43858D39; Sun, 12 Dec 2021 23:16:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A7E43858D39 From: "robert.muench at saphirion dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/103670] Incorrect optimization of loop termination: Early exit with any optimization Date: Sun, 12 Dec 2021 23:16:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 10.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: robert.muench at saphirion dot com X-Bugzilla-Status: WAITING 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 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: Sun, 12 Dec 2021 23:16:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103670 --- Comment #3 from Robert M. M=C3=BCnch --- I updated to GCC 11.2, which has the same problem but after 4 rounds, not 3. GCC 10.3 Output: 9512] =3D=3D> GetAdapterMACAddress [9512] parameter check dwRetVal: 0 number: 0 [9512] AddressLenth: 6 [9512] i: 0 offset: 0, AddressLenth: 6 [9512] i: 1 offset: 3, AddressLenth: 6 [9512] i: 2 offset: 6, AddressLenth: 6 [9512] <- OK: 00-1C-42- AddressLength: 3 GCC 11.2 Output: [7128] =3D=3D> GetAdapterMACAddress [7128] parameter check dwRetVal: 0 number: 0 [7128] AddressLenth: 6 [7128] i: 0 offset: 0, AddressLenth: 6 [7128] i: 1 offset: 3, AddressLenth: 6 [7128] i: 2 offset: 6, AddressLenth: 6 [7128] i: 3 offset: 9, AddressLenth: 6 [7128] <- OK: 00-1C-42-10- AddressLength: 4=