From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26ADA3858288; Fri, 3 Mar 2023 09:59:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26ADA3858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677837564; bh=5c4ilmmvi/2SeKLaI7yKWxWS5rGNDHTFzxSi77y2t4w=; h=From:To:Subject:Date:From; b=CWL8C3uPeoNUSnfgeaBvg9XZ6RjPXgWhMnR3wlcFfcEs1xe8aoNiRARMNPT++Hh8/ OptZ7uM8K7zciAPJ6+iiLttb5Hpv7Iom7Ilp5EO1TbeCasbuT1F8469J3+5HIULe9U epy5NUjzRGW9/sVawHXS8NeSaGC7T/cuEx9aXeF8= From: "bugreporter66 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109004] New: wrong code for -O2 (any above -O0) with g++ 11.3 for POWER9 (cross-compiler on x86_64 host) Date: Fri, 03 Mar 2023 09:59:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bugreporter66 at gmail 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109004 Bug ID: 109004 Summary: wrong code for -O2 (any above -O0) with g++ 11.3 for POWER9 (cross-compiler on x86_64 host) Product: gcc Version: 11.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bugreporter66 at gmail dot com Target Milestone: --- Created attachment 54574 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54574&action=3Dedit archive with all the necessary source and output files The code sample is attached with all the necessary output files. It's a regression from g++ 9.x series, where it worked properly. The line that fails the test is a ternary operator working on two memory floating point operands: farr[n] < farr[m] ? farr[n] : farr[m]; Two potential workarounds for this are turning optimizations off (-O0) or re-targeting to POWER8 instead (-O2 -mcpu=3Dpower8). The test case is taken from https://github.com/VectorChief/UniSIMD-assemble= r, where that test fails (v1.1.0c) for POWER9 target on Ubuntu MATE 22.04.2=