From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1EC93858292; Tue, 5 Jul 2022 08:00:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1EC93858292 From: "mathieu.malaterre at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106187] armhf: Miscompilation at O2 level (O0 / O1 are working) Date: Tue, 05 Jul 2022 08:00:13 +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: 10.4.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mathieu.malaterre at gmail dot com X-Bugzilla-Status: WAITING 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: 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, 05 Jul 2022 08:00:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106187 --- Comment #8 from Mathieu Malaterre = --- (In reply to Jan Wassenberg from comment #7) > The easiest way to reduce the amount of code in the binary is to comment = out > from mul_test.cc all the HWY_EXPORT_AND_TEST_P except the one with > TestAllMulEven. >=20 > The actual miscompilation is probably happening within ops/emu128-inl.h. >=20 > You can further reduce instantiations by replacing > ForFloatTypes(ForPartialVectors()); > with > TestMulAdd()(float(), FixedTag()); >=20 > That gets us down to a fairly minimal single TU (mul_test.cc). Bingo ! Program received signal SIGABRT, Aborted. 0xb6cafe86 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6 (gdb) bt #0 0xb6cafe86 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6 #1 0xb6cbf0e4 in raise () from /lib/arm-linux-gnueabihf/libc.so.6 #2 0xb6cafa16 in abort () from /lib/arm-linux-gnueabihf/libc.so.6 #3 0x00416a2c in hwy::Abort (file=3Dfile@entry=3D0x43acf8 "/home/malat/highway/hwy/tests/mul_test.cc", line=3Dline@entry=3D308, format=3D0x43b6ec "%s, %sx%llu lane %llu mismatch: expected '%s', got '%s'.= \n") at /home/malat/highway/hwy/targets.cc:322 #4 0x00416cbc in hwy::detail::PrintMismatchAndAbort (info=3D..., expected_ptr=3Dexpected_ptr@entry=3D0x0, actual_ptr=3D0x467580, actual_ptr@entry=3D0x43acf8, target_name=3Dtarget_name@entry=3D0x43ad24 "Em= u128", filename=3D0x43acf8 "/home/malat/highway/hwy/tests/mul_test.cc", filename@entry=3D0xb6ff3010 "", line=3Dline@entry=3D308, lane=3D0, num_lanes=3Dnum_lanes@entry=3D4) at /home/malat/highway/hwy/tests/test_util= .cc:90 #5 0x00416d54 in hwy::detail::AssertArrayEqual (info=3D..., expected_void=3Dexpected_void@entry=3D0x467500, actual_void=3Dactual_void@entry=3D0x467580, N=3DN@entry=3D4, target_name=3D= 0x43ad24 "Emu128", filename=3D0x43acf8 "/home/malat/highway/hwy/tests/mul_test.cc", line= =3D308) at /home/malat/highway/hwy/tests/test_util.cc:113 #6 0x004108ae in hwy::N_EMU128::AssertVecEqual, float, hwy::N_EMU128::Vec128 > (line=3D308, filename=3D0x43a= cf8 "/home/malat/highway/hwy/tests/mul_test.cc", actual=3D..., expected=3D0x467500, d=3D...) at /home/malat/highway/hwy/tests/test_util-inl.h:51 #7 hwy::N_EMU128::TestMulAdd::operator() > (d=3D..., this=3D) at /home/malat/highway/hwy/tests/mul_test.cc:308 #8 0x0043a114 in void testing::internal::HandleExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) ()=