public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95366] New: TYPE IS(character(*)) no longer matches
@ 2020-05-27 13:55 gcc at abeckmann dot de
  2020-05-27 14:27 ` [Bug fortran/95366] [10/11 Regression] TYPE IS(character(*)) no longer matches since r10-3605-gf61e54e59cda5a2e marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc at abeckmann dot de @ 2020-05-27 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95366
           Summary: TYPE IS(character(*)) no longer matches
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at abeckmann dot de
  Target Milestone: ---

Created attachment 48618
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48618&action=edit
2 modules and a main program that demonstrate the bug

This is a regression in gfortran-10: in some cases 
  SELECT TYPE (arg)
  TYPE IS(CHARACTER(*))
    ...
  CLASS DEFAULT
    ...
does not match a polymorphic (class(*)) argument as character but falls through
to the class default, even though the subroutine was called with a
character(len=42) argument. This bug seems require caller and callee residing
in different modules (i.e. different compilation units).

A test case is attached:

gfortran-10 -W -Wall -Wextra  -c -o mod1.o mod1.f90
gfortran-10 -W -Wall -Wextra  -c -o mod2.o mod2.f90
gfortran-10 -W -Wall -Wextra  -c -o main.o main.f90
gfortran-10 main.o mod1.o mod2.o
./a.out
 int
 unknown

while building with gfortran-9 works:

gfortran-9 -W -Wall -Wextra  -c -o mod1.o mod1.f90
gfortran-9 -W -Wall -Wextra  -c -o mod2.o mod2.f90
gfortran-9 -W -Wall -Wextra  -c -o main.o main.f90
gfortran-9 main.o mod1.o mod2.o
./a.out
 int
 char

I observed this with the Debian 10.1.0-2 build (corresponding to git as of
20200515) and I could confirm it with git master
(6c8e16aea85286721eb5689f9bcae09d36003cb1).

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

end of thread, other threads:[~2020-07-05 17:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:55 [Bug fortran/95366] New: TYPE IS(character(*)) no longer matches gcc at abeckmann dot de
2020-05-27 14:27 ` [Bug fortran/95366] [10/11 Regression] TYPE IS(character(*)) no longer matches since r10-3605-gf61e54e59cda5a2e marxin at gcc dot gnu.org
2020-05-28  7:35 ` rguenth at gcc dot gnu.org
2020-06-13  7:13 ` tkoenig at gcc dot gnu.org
2020-06-30 13:59 ` tkoenig at gcc dot gnu.org
2020-07-05 17:51 ` cvs-commit at gcc dot gnu.org
2020-07-05 17:52 ` tkoenig 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).