From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F0B9E3858407; Thu, 20 Jan 2022 18:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0B9E3858407 From: "meissner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104136] Gcc cannot compile wrf_r for power10 using -Ofast Date: Thu, 20 Jan 2022 18:27:48 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: meissner at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: meissner at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: Thu, 20 Jan 2022 18:27:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104136 --- Comment #1 from Michael Meissner --- Created attachment 52244 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D52244&action=3Dedit Patch to mark XXSPLTIW and XXSPLTIDP as possibly being prefixed If you compile module_advect_em.F90 with -Ofast -mcpu=3Dpower10, one module is large enough that we can't use a single conditional jump to span the function. Instead, we have to reverse the condition, and do a conditional jump around an unconditional branch. It turns out when xxspltiw and xxspltdp instructions were generated, they were not marked as being prefixed (i.e. length of 12 bytes instead of 4 bytes). This meant the calculations for the branch length were off, which in turn meant the assembler raised an error because it couldn't do the conditional jump. The fix is to set the maybe_prefixed attribute so that insns with the type 'vecperm' might be prefixed. Then in the code that optionally puts a 'p' in front of the insn skip doing so for the permutes (i.e. load constant with splat instruction).=