public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/100724] New: -fwhole-program breaks module use
@ 2021-05-22 14:21 fx at gnu dot org
  2021-05-23 19:19 ` [Bug fortran/100724] " anlauf at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fx at gnu dot org @ 2021-05-22 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100724
           Summary: -fwhole-program breaks module use
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fx at gnu dot org
  Target Milestone: ---

I found that trying gfortran -fwhole-program failed to link a case I tried,
with undefined references to routines with interface blocks.  It's OK with
gfortran 10.
Here's a trivial example (on Debian 10, but I don't suppose that matters):

$ gfortran-11 --version
GNU Fortran (GCC) 11.1.0
$ cat test.f90
module tw
  interface
     real function twice (x)
     end function twice
  end interface
end module tw

real function twice (x)
  twice = 2*x
end function twice

use tw
read *, x
print *, twice (x)
end
$ gfortran-11 -O -fwhole-program test.f90 
/usr/bin/ld: /tmp/ccBKHiLp.o: in function `MAIN__':
test.f90:(.text+0x7d): undefined reference to `twice_'
collect2: error: ld returned 1 exit status

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

end of thread, other threads:[~2021-05-25 19:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 14:21 [Bug fortran/100724] New: -fwhole-program breaks module use fx at gnu dot org
2021-05-23 19:19 ` [Bug fortran/100724] " anlauf at gcc dot gnu.org
2021-05-24 11:04 ` fx at gnu dot org
2021-05-24 19:59 ` anlauf at gcc dot gnu.org
2021-05-25  7:18 ` rguenth at gcc dot gnu.org
2021-05-25 10:48 ` fx at gnu dot org
2021-05-25 19:19 ` hubicka at ucw dot cz

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