From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E6B43858420; Mon, 29 Jan 2024 23:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E6B43858420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706570046; bh=QTFGZmg7um/4Djwq382K4Zhf3O+ERQ5YKRvLVM4lo3o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IXHAMILaMNb/dh30KV+RaNFZfFDy7Ve89rU/CeysOcz46gZD1dbWavWHKtAmnGA3q sADrhek0sM1TVi7HA7ercf1gOzl7wCDKo/D+PjF0TDeQlvNU7+K74LP/+ymwAwW4hd rzHzLOCC0w1tqANsOpY1fHhCURiIhkPmzdfJJJIs= From: "christoph at muppetnet dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113665] Regular for Loop results in Endless Loop with -O2 Date: Mon, 29 Jan 2024 23:14:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: christoph at muppetnet dot net 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=3D113665 --- Comment #1 from Christoph R=C3=BCthing = --- Note, that the volatile variables are just there to provide a minimal examp= le and not have the entire loop optimized away. In the origian implementation I deduced this minimal example from, there was actually a useful implementati= on. But putting e.g. a std::cout at this place also solved the issue.=