From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20680 invoked by alias); 25 Jul 2010 10:03:55 -0000 Received: (qmail 20570 invoked by uid 48); 25 Jul 2010 10:03:40 -0000 Date: Sun, 25 Jul 2010 10:03:00 -0000 Message-ID: <20100725100340.20569.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40873] -fwhole-file -fwhole-program: Wrong decls cause too much to be optimized away In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dominiq at lps dot ens dot fr" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02753.txt.bz2 ------- 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