From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 588223A71C22; Fri, 23 Apr 2021 10:27:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 588223A71C22 From: "iii at linux dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100217] [11/12 Regression] ICE when building valgrind testsuite with -march=z14 since r11-7552 Date: Fri, 23 Apr 2021 10:27:27 +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.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: iii at linux dot ibm.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Fri, 23 Apr 2021 10:27:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100217 Ilya Leoshkevich changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |iii at linux dot ibm.com --- Comment #3 from Ilya Leoshkevich --- There main problem here is that `register long double f0 asm ("f0")` does n= ot make sense on z14 anymore. long doubles are stored in vector registers now,= not in floating-point register pairs. If we skip the hard reg, the code will en= d up having the following semantics: vr0[0:128] =3D 1.0L; asm("/* expect the value in vr0[0:64] . vr2[0:64] */"); and fail during the run time. So I think it's better to use the "best effor= t" approach and force it into a pseudo, even if this would mean that the user-specified register is not honored: --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -16814,6 +16814,12 @@ s390_md_asm_adjust (vec &outputs, vec &inputs, gcc_assert (allows_reg); /* Copy input value from a vector register into a FPR pair. */ rtx fprx2 =3D gen_reg_rtx (FPRX2mode); + if (REG_P (inputs[i]) && HARD_REGISTER_P (inputs[i])) + { + rtx orig_input =3D inputs[i]; + inputs[i] =3D gen_reg_rtx (TFmode); + emit_move_insn (inputs[i], orig_input); + } emit_insn (gen_tf_to_fprx2 (fprx2, inputs[i])); inputs[i] =3D fprx2; input_modes[i] =3D FPRX2mode; I need to check whether we can keep the output logic as is. Ideally the code should be adapted and use the __LONG_DOUBLE_VX__ macro like this: #ifdef __LONG_DOUBLE_VX__ register long double f0 asm ("v0"); #else register long double f0 asm ("f0"); #endif f0 =3D 1.0L; #ifdef __LONG_DOUBLE_VX__ asm("" : : "v" (f0)); #else asm("" : : "f" (f0)); #endif Maybe a warning recommending to do this should be printed.=