This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: PR fortran/33197, use MPC for complex "arc" functions
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, gcc patches <gcc-patches at gcc dot gnu dot org>, fortran at gcc dot gnu dot org
- Date: Fri, 02 Oct 2009 11:23:46 -0700
- Subject: Re: [PATCH]: PR fortran/33197, use MPC for complex "arc" functions
- References: <Pine.GSO.4.58.0910010555290.28163@caipclassic.rutgers.edu> <4AC48320.2090902@net-b.de> <BEA33B8F298241C9B8B358666EC5DC20@glap> <4AC5AC41.6080307@net-b.de>
- Reply-to: janis187 at us dot ibm dot com
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