A patch to fix the most obvious failures with -fwhole-file

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Dec 14 16:46:00 GMT 2009


On Mon, Dec 14, 2009 at 05:18:58PM +0100, Dominique Dhumieres wrote:
> > Do the testcases run without your patch?
> 
> They pass without -fwhole-file and indeed they fail with it,
> otherwise I won't be stupid enough to care!
> 
> > > -  call bar (a, LBOUND(a),2)
> > > +  call bar (a, LBOUND(a,1),2)
> >
> > DIM is optional.  This changes the code path through
> > the compiler.
> 
> Without DIM, LBOUND returns a vector, with it, it returns
> the scalar expected by bar.
> 
> The prints are left over of my testing and can easily be fixed.
> 
> > > -      REAL LOGICAL
> > > +!      REAL LOGICAL
> >
> > This changes the intent of the code. ...
> 
> Then the test should be skiped if -fwhole-file is supplied.
> 

-fwhole-file isn't used by the testsuite.   Don't use -fwhole-file
as a general option with the testsuite.  If you want to test
the effect of this option write well-defined small programs and
add '! { dg-options "-fwhole-file" } in the prologue.  See, for
example, 

laptop:kargl[205] grep fwhole *
pr40999.f:! { dg-options "-O3 -fwhole-file" }
pr41011.f:! { dg-options "-O3 -fwhole-file" }
whole_file_1.f90:! { dg-options "-fwhole-file" }
whole_file_10.f90:! { dg-options "-fwhole-file" }
whole_file_11.f90:! { dg-options "-fwhole-file" }
whole_file_12.f90:! { dg-options "-fwhole-file" }
whole_file_13.f90:! { dg-options "-fwhole-file -O3" }
whole_file_14.f90:! { dg-options "-fwhole-file -O3" }
whole_file_2.f90:! { dg-options "-fwhole-file" }
whole_file_3.f90:! { dg-options "-fwhole-file" }
whole_file_4.f90:! { dg-options "-fwhole-file -std=legacy" }
whole_file_5.f90:! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
whole_file_6.f90:! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
whole_file_7.f90:! { dg-options "-fwhole-file" }
whole_file_7.f90:! This function would not compile because -fwhole-file would
whole_file_8.f90:! { dg-options "-fwhole-file" }
whole_file_9.f90:! { dg-options "-fwhole-file" }

This is a clear example of why changing the testsuite when
someone uses nonstandard testsuite options is questionable.

-- 
Steve



More information about the Fortran mailing list