public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98408] New: Character lengths for allocatable character arrays
@ 2020-12-21  8:35 tkoenig at gcc dot gnu.org
  2020-12-21 10:33 ` [Bug fortran/98408] " pault at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-12-21  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98408
           Summary: Character lengths for allocatable character arrays
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

Consider

program main
  character (len=:), allocatable :: a(:)
  allocate (character(len=10) :: a(5))
end program main

This yields (in the tree dump)

  D.3941 = (bitsizetype) (sizetype) NON_LVALUE_EXPR <.a> * 8;
  D.3942 = (sizetype) NON_LVALUE_EXPR <.a>;
  a.data = 0B;
  {
    integer(kind=4) overflow.0;
    logical(kind=4) not_prev_allocated.1;

    .a = 10;

And later, if you use

size_in_bytes (gfc_get_element_type (TREE_TYPE(se->expr)))

you get an undefined variable.

Strange...

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

end of thread, other threads:[~2023-04-08  9:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21  8:35 [Bug fortran/98408] New: Character lengths for allocatable character arrays tkoenig at gcc dot gnu.org
2020-12-21 10:33 ` [Bug fortran/98408] " pault at gcc dot gnu.org
2021-02-14 12:16 ` dominiq at lps dot ens.fr
2023-03-28 10:09 ` pault at gcc dot gnu.org
2023-04-08  8:04 ` cvs-commit at gcc dot gnu.org
2023-04-08  9:36 ` pault 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).