From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2A053951C67; Tue, 24 Nov 2020 23:44:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2A053951C67 From: "i at maskray dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/66512] PRE fails to optimize calls to pure functions in C++, ok in C Date: Tue, 24 Nov 2020 23:44:41 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me 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: cc 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: Tue, 24 Nov 2020 23:44:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66512 Fangrui Song changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |i at maskray dot me --- Comment #4 from Fangrui Song --- Should this be reopened? https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html 'const' = is not clarified on its interaction with threads (https://gcc.gnu.org/legacy-ml/gcc/2015-09/msg00365.html) and=20 void f() { for (;;) g(p()); } is still pessimized for C++ (I tend to agree that 'const' should imply 'nothrow'; even if no, the #c2 case should be resolved properly)=