From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EE97383E82B; Tue, 23 Jun 2020 14:34:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EE97383E82B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592922844; bh=fX6je1Cdc5JLaj3uGf02B6vlMzp2ogg5gT/CH2IpkWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oII4NS8ZWwI0Be8O25I4Me57W2+I1gUizZ3snAjJRi1qN70pA5JLjMmrMb3DkrW3E sgY3o3DbY6Jxs2jm0i5/24YKTARP1+LSx22hK37ukm35aAfLovN6tg3Y+YIpzGSS28 ba5t4+jh8VSnHjmuJRIysqiPmdXGNpUkx40quAG8= From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95676] [armhf] g++ mis-compiles code at -O1 or above Date: Tue, 23 Jun 2020 14:34:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org 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: bug_status resolution 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, 23 Jun 2020 14:34:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95676 Alex Coplan changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #4 from Alex Coplan --- Looks like the program has undefined behavior (signed integer overflow), so= not a compiler bug. $ cat test.cc #include bool check_equality() { std::chrono::system_clock::time_point v(std::chrono::system_clock::time_point::min()); msgpack::zone z; msgpack::object obj(v, z); return obj.as() =3D=3D v; } int main() { return check_equality() ? 42 : 0; } $ g++ test.cc -fsanitize=3Dundefined -I msgpack-c/include/ -I boost_1_73_0 $ ./a.out /usr/include/c++/7/chrono:176:38: runtime error: signed integer overflow: -9223372037 * 1000000000 cannot be represented in type 'long int' /usr/include/c++/7/chrono:379:8: runtime error: signed integer overflow: 9223372036709551616 + 145224192 cannot be represented in type 'long int' I get the same result with clang++ as well.=