From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D78893858D38; Thu, 21 Mar 2024 19:53:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D78893858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711050809; bh=JQHbv0lbofsfYN618TnJ+VhUhqgTjeKCAm2XX3Ktsv0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JL0wY0vPz6jw+hn+ROv18CyjlB3XYEGJByojY1L9epUWQHGZ0ZdqGP2hVPeF9pcd+ +NU02WYyTCZCo5N6Grw8xkAtgu9d+pHOZ9QQWoSNW5kFCrRndmnG+TDfE2Dj3nxKI6 /SFvuHHsMZCZRbEya6OdPfKfkKcNPiz0wFS2EmZY= From: "earlephilhower at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114421] arm-none-eabi thumb -Os (and -O2) incorrectly optimizes out needed class member call Date: Thu, 21 Mar 2024 19:53:29 +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: 12.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: earlephilhower at yahoo dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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=3D114421 --- Comment #2 from Earle F. Philhower, III --- Thanks very much for the fast explanation. For reference of others who mig= ht hit this, I see references to C11 6.8.5 pp 6 online (but of course it's an = ISO document so not freely available). "An iteration statement whose controlling expression is not a constant expression, that performs no input/output operations, does not access volat= ile objects, and performs no synchronization or atomic operations in its body, controlling expression, or (in the case of a for statement) its expression-= 3, may be assumed by the implementation to terminate."=