public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95837] New: derived-type components of character kind=4 – wrong code with component access (kind=4 ignored)
@ 2020-06-23  9:54 burnus at gcc dot gnu.org
  2020-06-23 16:44 ` [Bug fortran/95837] " dominiq at lps dot ens.fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-06-23  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95837
           Summary: derived-type components of character kind=4 – wrong
                    code with component access (kind=4 ignored)
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Compare:
---------------
type t
  character(len=:, kind=4), pointer :: str2
end type t
type(t) :: var
character(len=:, kind=4), pointer :: str

str(1:1) = 4_"a"
str(1:2) = 4_"bc"
var%str2(1:1) = 4_"d"
var%str2(1:2) = 4_"ef"
end
---------------

The dump shows that 'str' is properly handled:
  (*str)[1]{lb: 1 sz: 4} = "a\x00\x00"[1]{lb: 1 sz: 4};
  __builtin_memmove ((void *) str,
                     (void *) &"b\x00\x00\x00c\x00\x00"[1]{lb: 1 sz: 4}, 8);

But the component reference ignores the kind=4:
   *(character(kind=1) *) var.str2 = 100;
  __builtin_memmove ((void *) var.str2,
                     (void *) &"ef"[1]{lb: 1 sz: 1}, 2);

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-15 10:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23  9:54 [Bug fortran/95837] New: derived-type components of character kind=4 – wrong code with component access (kind=4 ignored) burnus at gcc dot gnu.org
2020-06-23 16:44 ` [Bug fortran/95837] " dominiq at lps dot ens.fr
2020-06-23 17:27 ` kargl at gcc dot gnu.org
2020-06-23 18:29 ` kargl at gcc dot gnu.org
2020-06-23 21:11 ` kargl at gcc dot gnu.org
2020-06-24  7:16 ` burnus at gcc dot gnu.org
2020-06-25 14:59 ` cvs-commit at gcc dot gnu.org
2020-06-25 15:00 ` burnus at gcc dot gnu.org
2020-07-15 10:34 ` cvs-commit at gcc dot gnu.org

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).