This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[fortran,patch] Last widechar intrinsics and a few related fixes


Attached patch tests (and fixes where fixing was needed) the last
intrinsics that can be used with wide strings. It also includes two
related fixes that have come to my attention during the testing of
these intrinsics (one independently reported by Jerry as PR36319, and
the other one actually affecting all character kinds). The highlights
of the patch are (read: everything else is dead boring!):

  -- The simplify.c part is the one that fixes PR36319: in my
implementation of the constant character conversion simplification
routine, I forgot to deal with the case of array constructors; these
are easily treated by recursive calls to gfc_convert_char_constant().
  -- In intrinsic.c, I previously marked char conversion symbols as
pure, but that triggers errors in some cases of parameter array
constructors (included in the testcases in this patch), because a
CHARACTER(LEN=*) function can't be pure. So, I remove it.
  -- The trans-intrinsic.c part includes some minor attempts at making
the code more readable, as well as correcting SIZE/SIZEOF and TRANSFER
implementations by correctly calculating the size of wide-character
strings.
  -- The trans-array.c part fixes an issue with kind conversion inside
array constructors.

On the library side, apart from adding _char4 variants of all the
eoshift and cshift functions, the only interesting thing is the change
to filler in eoshift. This used to be a single byte which is used to
fill elements of the result array when the user didn't give a BOUNDARY
arg. With wide characters, this needs to be a multibyte pattern (it is
(gfc_char4_t) ' ', which is either " \0\0\0" or "\0\0\0 " depending on
endianness), so I made it so. I don't think it breaks the ABI, but I'd
still appreciate if someone can give it a second look!

Bootstrapped and regtested on x86_64-linux (-m32 and -m64). OK to commit?

FX

PS: With that patch in, all that is remaining for full i18n-charset
support will be I/O.

-- 
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/

Attachment: wide_char_part7.ChangeLog
Description: Binary data

Attachment: wide_char_part7.diff
Description: Binary data


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