public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iii at linux dot ibm.com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-100217-4-d3Qrbl2OxH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100217-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100217

Ilya Leoshkevich <iii at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iii at linux dot ibm.com

--- Comment #3 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
There main problem here is that `register long double f0 asm ("f0")` does not
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 end up
having the following semantics:

vr0[0:128] = 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 effort"
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<rtx> &outputs, vec<rtx>
&inputs,
       gcc_assert (allows_reg);
       /* Copy input value from a vector register into a FPR pair.  */
       rtx fprx2 = gen_reg_rtx (FPRX2mode);
+      if (REG_P (inputs[i]) && HARD_REGISTER_P (inputs[i]))
+       {
+         rtx orig_input = inputs[i];
+         inputs[i] = gen_reg_rtx (TFmode);
+         emit_move_insn (inputs[i], orig_input);
+       }
       emit_insn (gen_tf_to_fprx2 (fprx2, inputs[i]));
       inputs[i] = fprx2;
       input_modes[i] = 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 = 1.0L;

#ifdef __LONG_DOUBLE_VX__
  asm("" : : "v" (f0));
#else
  asm("" : : "f" (f0));
#endif

Maybe a warning recommending to do this should be printed.

  parent reply	other threads:[~2021-04-23 10:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 18:24 [Bug target/100217] New: " jakub at gcc dot gnu.org
2021-04-22 18:25 ` [Bug target/100217] " jakub at gcc dot gnu.org
2021-04-22 18:34 ` jakub at gcc dot gnu.org
2021-04-23  8:22 ` jakub at gcc dot gnu.org
2021-04-23 10:27 ` iii at linux dot ibm.com [this message]
2021-04-23 10:31 ` jakub at gcc dot gnu.org
2021-04-23 11:00 ` jakub at gcc dot gnu.org
2021-04-23 11:20 ` iii at linux dot ibm.com
2021-04-23 11:27 ` jakub at gcc dot gnu.org
2021-04-23 11:39 ` jakub at gcc dot gnu.org
2021-04-23 11:56 ` iii at linux dot ibm.com
2021-04-26 14:40 ` iii at linux dot ibm.com
2021-04-27 11:40 ` jakub at gcc dot gnu.org
2021-04-28 18:22 ` mark at gcc dot gnu.org
2021-04-28 19:14 ` jakub at gcc dot gnu.org
2021-04-29  9:58 ` mark at gcc dot gnu.org
2021-05-03 10:50 ` cvs-commit at gcc dot gnu.org
2021-05-06  1:26 ` cvs-commit at gcc dot gnu.org
2021-06-11 13:43 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100217-4-d3Qrbl2OxH@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).