From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DBB6D3858284; Mon, 18 Jul 2022 14:40:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBB6D3858284 From: "malat at debian dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106322] i386: Wrong code at O2 level (O0 / O1 are working) Date: Mon, 18 Jul 2022 14:40:09 +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: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: malat at debian dot org 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: Mon, 18 Jul 2022 14:40:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106322 --- Comment #9 from Mathieu Malaterre --- (In reply to Andrew Pinski from comment #8) > Does -fwrapv fix the issue? No. This seems like the exact same symptoms: % ./tests/mul_test "--gtest_filter=3DHwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu128"=20=20= =20=20=20=20=20=20=20=20 Running main() from ./googletest/src/gtest_main.cc Note: Google Test filter =3D HwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu1= 28 [=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from HwyMulTestGroup/HwyMulTest [ RUN ] HwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu128 i16x8 expect [0+ ->]: 0x3FFF,0x0FFF,0x03FF,0x00FF,0x003F,0x000F,0x0003, i16x8 actual [0+ ->]: 0xBFFF,0x0FFF,0xE400,0x00FF,0xF840,0x000F,0xFE04, Abort at /home/malat/highway-0.17.1~git20220711.f0a396a/hwy/tests/mul_test.cc:131: Emu128, i16x8 lane 0 mismatch: expected '0x3FFF', got '0xBFFF'. Technically I can also execute the `uint16` portion of the unit test and produce a failure (so this seems to be consistent behavior with signed counterpart): ``` HWY_NOINLINE void TestAllMulHigh() { ForPartialVectors test; // test(int16_t()); test(uint16_t()); } ``` And then: ``` % ./tests/mul_test "--gtest_filter=3DHwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu128"=20=20= =20=20=20=20=20=20=20=20 Running main() from ./googletest/src/gtest_main.cc Note: Google Test filter =3D HwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu1= 28 [=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from HwyMulTestGroup/HwyMulTest [ RUN ] HwyMulTestGroup/HwyMulTest.TestAllMulHigh/Emu128 u16x8 expect [0+ ->]: 0xFFFE,0x3FFF,0x0FFF,0x03FF,0x00FF,0x003F,0x000F, u16x8 actual [0+ ->]: 0xFFFF,0x3FFF,0xD000,0x03FF,0xF100,0x003F,0xFC10, Abort at /home/malat/highway-0.17.1~git20220711.f0a396a/hwy/tests/mul_test.cc:131: Emu128, u16x8 lane 0 mismatch: expected '0xFFFE', got '0xFFFF'. ```=