public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: Jakub Jelinek <jakub@redhat.com>,
	gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [PATCH] libfortran: Fix up boz_15.f90 on powerpc64le with -mabi=ieeelongdouble [PR106079]
Date: Sun, 31 Jul 2022 13:01:47 +0200	[thread overview]
Message-ID: <12c633ba-c5c2-bb89-8331-9702411109e1@netcologne.de> (raw)
In-Reply-To: <YuUX4AYU3IKRnz/+@tucnak>

Hi Jakub,

> The boz_15.f90 test FAILs on powerpc64le-linux when -mabi=ieeelongdouble
> is used (either default through --with-long-double-format=ieee or
> when used explicitly).
> The problem is that the read/write transfer routines are called with
> BT_REAL (or BT_COMPLEX) type and kind 17 which is magic we use to say
> it is the IEEE quad real(kind=16) rather than the IBM double double
> real(kind=16).  For the floating point input/output we then handle kind
> 17 specially, but for B/O/Z we just treat the bytes of the floating point
> value as binary blob and using 17 in that case results in unexpected
> behavior, for write it means we don't estimate right how many chars we'll
> need and print ******************** etc. rather than what we should, and
> even with explicit size we'd print one further byte than intended.
> For read it would even mean overwriting some unrelated byte after the
> floating point object.
> 
> Fixed by using 16 instead of 17 in the read_radix and write_{b,o,z} calls.
> 
> Bootstrapped/regtested on powerpc64le-linux, ok for trunk / 12.2?

OK for both.

Best regards

	Thomas

      reply	other threads:[~2022-07-31 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30 11:37 Jakub Jelinek
2022-07-31 11:01 ` Thomas Koenig [this message]

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=12c633ba-c5c2-bb89-8331-9702411109e1@netcologne.de \
    --to=tkoenig@netcologne.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).