From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B84C73858D34; Mon, 15 Jun 2020 04:33:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B84C73858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592195597; bh=t5UIXFWVSzbLzQFHm+OX4Xzf4iTWJPzq+D83bm4AyWI=; h=From:To:Subject:Date:From; b=UF1cRXUuPimm1E6JWlOOEYtEepTKTrKkTzLxOGBaM8CNXiC9XZqXJqop5XUk5vs0r z2AmLRMSWwRsyDjhyWD23mInfP287XYkRXtp9isJrKrYPTnwbVEQN+ecugpAuCMoLY dIs2L495ZYZ7WATQN7GuWp9Fpv1cqw80YnfbDBoQ= From: "jamessan at jamessan dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95676] New: [armhf] g++ mis-compiles code at -O1 or above Date: Mon, 15 Jun 2020 04:33:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamessan at jamessan dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: Mon, 15 Jun 2020 04:33:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95676 Bug ID: 95676 Summary: [armhf] g++ mis-compiles code at -O1 or above Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jamessan at jamessan dot com Target Milestone: --- Created attachment 48730 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48730&action=3Dedit Reduced test case After uploading msgpack-c 3.3.0 to Debian, the armhf build failed due to a specific test failing. I originally reported this to msgpack-c's upstream: https://github.com/msgpack/msgpack-c/issues/881 However, after testing on Debian's porterbox, it seems to be a GCC issue. = The issue does not reproduce when compiled with -O0 but does with -O1 or higher. Similarly, changing the line that was failing from using googletest's "EXPECT_TRUE(foo =3D=3D bar);" to "EXPECT_EQ(foo, bar);" caused the test to= pass. I was able to use creduce to produce the attached file, test.cpp, which exhibits the problem. The final assignment in main (cd =3D ce.aq() =3D=3D g;) should always evaluate to true.=