From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 11B8D3858D39; Thu, 16 Mar 2023 11:49:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11B8D3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678967345; bh=2pG+IHSWohCmaQOi3eE+DUTH5yP1R81v9h379QDH310=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZJHsOXpCQ8mbYOThIqV0s1IUD0AD5JJTeDXISdM6lvINWROQHlLJHYBzZbhLtPw2z ajlkKzbpt4byrwDVrMWqtMsdM+Eb0aLt/PekK5QmhTEIk3TJpH5VxA3z5H8DQ27Z27 Anobip5moZTkRczZo9WFUux6mf4DgQ55UdjZ7p70= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109004] [10/11/12/13 Regression] wrong code for -O2 (any above -O0) with g++ 11.3 for POWER9 (cross-compiler on x86_64 host) Date: Thu, 16 Mar 2023 11:49: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: 11.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WORKSFORME X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109004 --- Comment #8 from Jakub Jelinek --- The program uses xsmincdp and xsmaxcdp instructions and it feels as if qemu implements the latter exactly the same as the former. So, I guess simpler testcase would be compile with -O2 -mcpu=3Dpower9 -ffas= t-math __attribute__((noipa)) float mymin (float x, float y) { return __builtin_fminf (x, y); } __attribute__((noipa)) float mymax (float x, float y) { return __builtin_fmaxf (x, y); } int main () { if (mymin (1.0f, 2.0f) !=3D 1.0f) __builtin_abort (); if (mymax (1.0f, 2.0f) !=3D 2.0f) __builtin_abort (); } and see if it aborts under qemu or not.=