[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#962853: [armhf] g++: Mis-compiles code using -O1 or higher



Package: g++-9
Version: 9.3.0-13
Severity: important
Tags: upstream
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95676
Control: affects -1 src:msgpack-c

msgpack-c's latest upload is failing a test on armhf:

--8<--
TEST(object_with_zone, system_clock_impl_min)
{
    std::chrono::system_clock::time_point v(std::chrono::system_clock::time_point::min());
    msgpack::zone z;
    msgpack::object obj(v, z);
    EXPECT_TRUE(obj.as<std::chrono::system_clock::time_point>() == v);
}
-->8--

The test succeeds if EXPECT_TRUE(foo == bar) is replaced with
EXPECT_EQ(foo, bar) or the left-hand side is stored in a local variable
first.

The test also succeeds if built with -O0.

I was able to create similar behavior without using googletest and then
run creduce produce a minimal test case, which is what was reported
upstream.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: armhf (armv7l)

Kernel: Linux 4.19.0-9-armmp-lpae (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages g++-9 depends on:
ii  gcc-9            9.3.0-13
ii  gcc-9-base       9.3.0-13
ii  libc6            2.30-8
ii  libgmp10         2:6.2.0+dfsg-6
ii  libisl22         0.22.1-1
ii  libmpc3          1.1.0-1
ii  libmpfr6         4.0.2-1
ii  libstdc++-9-dev  9.3.0-13
ii  zlib1g           1:1.2.11.dfsg-2

g++-9 recommends no packages.

Versions of packages g++-9 suggests:
pn  gcc-9-doc  <none>

-- no debconf information

-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB


Reply to: