This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40873] -fwhole-file -fwhole-program: Wrong decls cause too much to be optimized away
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2010 10:03:40 -0000
- Subject: [Bug fortran/40873] -fwhole-file -fwhole-program: Wrong decls cause too much to be optimized away
- References: <bug-40873-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #21 from dominiq at lps dot ens dot fr 2010-07-25 10:03 -------
With the patch in comment #18, I see all the failures reported in comment #19,
plus
FAIL: gfortran.dg/whole_file_9.f90 -O (internal compiler error)
FAIL: gfortran.dg/g77/13037.f -O3 -g (internal compiler error)
With -fwhole-program -O3 -g, most of the polyhedron tests fail either with
"internal compiler error: in output_die, at dwarf2out.c:11046" or with a
segmentation fault.
In addition without any option, I see several failures for codes with recursive
functions, such as (from pr27613):
program test
interface
function bad_stuff(n)
integer :: bad_stuff (2)
integer :: n(2)
end function bad_stuff
recursive function rec_stuff(n) result (tmp)
integer :: n(2), tmp(2)
end function rec_stuff
end interface
integer :: res(2)
res = bad_stuff((/-19,-30/))
print *, res
if (any (res .ne. (/25,25/))) call abort ()
if (any (rec_stuff((/-19,-30/)) .ne. (/25,25/))) call abort ()
end program test
recursive function bad_stuff(n)
integer :: bad_stuff (2)
integer :: n(2), tmp(2)
bad_stuff = rec_stuff (n)
if((maxval (n)>0).and.(maxval (n) < 2)) then
bad_stuff = bad_stuff + bad_stuff (maxval (n)+1)
endif
entry rec_stuff(n) result (tmp)
tmp=1
if(maxval (n) < 5) then
tmp = tmp + rec_stuff (n+1)
endif
end function bad_stuff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40873