This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, Fortran] pad char to int conversions with spaces instead of zeros (legacy)


On 12/12/2018 12:06, Mark Eggleston wrote:
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.

It was indeed necessary to only use 0x20 for padding when the source is known to be character. One more check was to transfer a character(4) variable to an integer(8) variable, there is no space padding. I don't yet know whether this matches the behaviour of other compilers.

I don't currently have access to other compilers. I can have some test cases performed on xlf and SunStudio but won't get any answers until after Christmas. The answer will determine whether I have any more work to do.

Mark


--
https://www.codethink.co.uk/privacy.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]