public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/111781] New: Compiler error on valid code
@ 2023-10-12  9:06 rasmus.vikhamar-sandberg at uit dot no
  2023-10-12 10:16 ` [Bug fortran/111781] Fortran compiler complains about variable bound in array dummy argument mikael at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rasmus.vikhamar-sandberg at uit dot no @ 2023-10-12  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111781
           Summary: Compiler error on valid code
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rasmus.vikhamar-sandberg at uit dot no
  Target Milestone: ---

Created attachment 56092
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56092&action=edit
Minimal fortran program to trigger error message

I have attached a minimal Fortran code example.f90 to trigger the compiler
error.
I ran "gfortran example.f90 -o example.x" and got error message
example.f90:8:31:

    8 |         real, intent(out) :: A(n)
      |                               1
Error: Variable ‘n’ cannot appear in the expression at (1)


If I replace f(g,A) with f(A,g) it compiles.
I think the code should be valid Fortran code since explicit-shape arrays that
are dummy arguments are allowed to have global variables as bounds.

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

end of thread, other threads:[~2024-04-02 13:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12  9:06 [Bug fortran/111781] New: Compiler error on valid code rasmus.vikhamar-sandberg at uit dot no
2023-10-12 10:16 ` [Bug fortran/111781] Fortran compiler complains about variable bound in array dummy argument mikael at gcc dot gnu.org
2023-10-21 14:01 ` mikael at gcc dot gnu.org
2023-10-21 16:37 ` mikael at gcc dot gnu.org
2024-02-06 18:19 ` anlauf at gcc dot gnu.org
2024-02-28 18:25 ` anlauf at gcc dot gnu.org
2024-02-28 19:38 ` mikael at gcc dot gnu.org
2024-03-15 19:37 ` mikael at gcc dot gnu.org
2024-03-15 19:57 ` anlauf at gcc dot gnu.org
2024-03-15 20:25 ` mikael at gcc dot gnu.org
2024-03-22 12:07 ` cvs-commit at gcc dot gnu.org
2024-03-28 10:40 ` cvs-commit at gcc dot gnu.org
2024-04-02 13:15 ` mikael 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).