public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mark Eggleston <mark.eggleston@codethink.co.uk>
Cc: Fritz Reese <fritzoreese@gmail.com>,
	fortran <fortran@gcc.gnu.org>,
	       gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, Fortran] pad char to int conversions with spaces instead of zeros (legacy)
Date: Wed, 12 Dec 2018 12:12:00 -0000	[thread overview]
Message-ID: <20181212121235.GI12380@tucnak> (raw)
In-Reply-To: <e0dbf769-a68f-0bab-1284-a63fcf45858b@codethink.co.uk>

On Wed, Dec 12, 2018 at 12:06:12PM +0000, Mark Eggleston wrote:
> 
> On 12/12/2018 11:52, Jakub Jelinek wrote:
> > What about:
> >    integer(kind=2) :: a
> >    a = -1
> >    print *, transfer (1_2, 1_8), transfer (a, 1_8)
> > end
> > ?
> 
> I assume you meant transfer (-1_2, 1_8), the result from gfortran is 65535
> for both transfers.

It doesn't really matter that much, the question is what is in the upper
bits and mainly a) what you get with the vendor compilers b) what you get
with your patch.  Because by my reading if you use there 0x20, it would
print 2314885530818510847 or 2314885530818445313 or something similar.
> 
> I'm about to build the compiler with
> 
>   memset (buffer, 0x20, buffer_size);
> 
> instead of
> 
>   memset (buffer, (flag_dec_pad_with_spaces ? 0x20 : 0x0), buffer_size);
> 
> and will check again, if necessary a padding variable can be used instead
> initially set to zero and changed to 0x20 when it is known that the source
> is character.

	Jakub

  reply	other threads:[~2018-12-12 12:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 14:47 Mark Eggleston
2018-12-04 15:11 ` Jakub Jelinek
2018-12-04 17:04   ` Fritz Reese
2018-12-06  2:27     ` Jerry DeLisle
2018-12-06 10:50       ` Jakub Jelinek
2018-12-06 10:54         ` Mark Eggleston
2018-12-07  1:57         ` Jerry DeLisle
2018-12-06 10:34     ` Mark Eggleston
2018-12-10 14:09       ` Mark Eggleston
2018-12-10 17:12         ` Jakub Jelinek
2018-12-10 19:44           ` Fritz Reese
2018-12-12 11:37           ` Mark Eggleston
2018-12-12 11:53             ` Jakub Jelinek
2018-12-12 12:06               ` Mark Eggleston
2018-12-12 12:12                 ` Jakub Jelinek [this message]
2018-12-12 15:12                 ` Mark Eggleston
2018-12-06 10:23   ` Mark Eggleston

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=20181212121235.GI12380@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=fritzoreese@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mark.eggleston@codethink.co.uk \
    /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).