public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102003] New: [PDT] Length of character component not simplified
@ 2021-08-20 19:11 anlauf at gcc dot gnu.org
  2022-06-13 13:11 ` [Bug fortran/102003] " wileamyp at outlook dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-08-20 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102003
           Summary: [PDT] Length of character component not simplified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

We should be able to simplify at compile time the following code:

  type pdt(n)
     integer, len     :: n = 8
     character(len=n) :: c
  end type pdt
  type(pdt(42)) :: p
  integer, parameter :: m = len (p% c)  ! rejected
  print *, len (p% c) == 42             ! works, but not simplified
end

Instead we currently get:

foo.f90:6:27:

    6 |   integer, parameter :: m = len (p% c)  ! rejected
      |                           1
Error: Cannot convert UNKNOWN to INTEGER(4) at (1)

(The code is accepted by Intel.)

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

end of thread, other threads:[~2024-04-26 16:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 19:11 [Bug fortran/102003] New: [PDT] Length of character component not simplified anlauf at gcc dot gnu.org
2022-06-13 13:11 ` [Bug fortran/102003] " wileamyp at outlook dot com
2023-06-30  8:22 ` pault at gcc dot gnu.org
2023-07-10 15:53 ` vehre at gcc dot gnu.org
2023-07-12 11:35 ` cvs-commit at gcc dot gnu.org
2023-07-20 11:56 ` vehre at gcc dot gnu.org
2024-04-26  7:07 ` cvs-commit at gcc dot gnu.org
2024-04-26 16:51 ` 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).