This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: PR fortran/33197, use MPC for complex "arc" functions


On Fri, 2009-10-02 at 09:31 +0200, Tobias Burnus wrote:
> On 10/02/2009 07:39 AM, Kaveh R. Ghazi wrote:
> > From: "Tobias Burnus" <burnus@net-b.de>
> >
> >> Regarding a test case: What kind of guidance do you need?
> >
> > Well I was considering just copying one of the
> > gfortran.dg/complex_intrinsic_*.f90 tests as a starting point. 
> > However I noticed that some of them are "run" tests.  But
> > complex_intrinsic_7.f90 is a wierd compile test that looks for "abort"
> > calls in the dump file rather than just executing the test.  I suppose
> > that "works" in a cross-config testrun but still it looks odd. :-)
> 
> Well, the advantage is that you are really testing the compile-time
> support; a run test would allow for no compile-time folding and for
> calling the library at run time. Besides, a compile test is faster than
> a run-time test. (An alternative would be to check for the digits in the
> dump or use the numbers in initialization expressions.)
> An advantage for using a run-time test in case of complex acos etc.
> would be that the check would always work: Either via MPC at compile
> time or - until MPC 0.8 is available - at run time. (Be careful,
> however, as the run-time libraries may not properly support operations
> involing/resulting in a real or imaginary +/-INF or NaN - or they may do
> different branch cuts.)
> 
> > Which style should I follow?
> Pick one which you like :-)

See the folding tests in gcc.dg, like builtins-7.c.  Tests that are not
run use { dg-do link } with calls to non-existent function link_error,
causing a link error if the expression is not folded.  The end result
is the same as checking that there are no calls to abort, but it's a bit
easier to understand the test.  The same trick could be used in an
executable self-checking test.

Janis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]