public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janne Blomqvist <blomqvist.janne@gmail.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Steve Kargl <sgk@troutmask.apl.washington.edu>,
	Eric Botcazou <ebotcazou@adacore.com>,
		Tobias Burnus <burnus@net-b.de>,
	gcc-patches@gcc.gnu.org, gfortran <fortran@gcc.gnu.org>
Subject: Re: [Patch, Fortran, committed] Add libquadmath testcase gfortran.dg/quad_2.f90
Date: Tue, 08 Nov 2011 16:34:00 -0000	[thread overview]
Message-ID: <CAO9iq9HUVa_fioe=EDuK5s8fW9Tunpncb5FAZoPp_oGu30QTBg@mail.gmail.com> (raw)
In-Reply-To: <yddbosmvcyb.fsf@manam.CeBiTec.Uni-Bielefeld.DE>

On Tue, Nov 8, 2011 at 17:41, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> Steve Kargl <sgk@troutmask.apl.washington.edu> writes:
>
>>> Please no: sqrtl is a C99 addition, and we don't want lists of non-C99
>>> targets in tests that require them.
>>>
>>
>> OK, so, then we simply accept that running a regression test
>> on these targets will always FAIL?  If the answer is 'yes',
>> then please close this PR because I doubt anyone will implement
>> sqrtl().
>
> No.  AFAICS so far C99 functions have been implemented in
> intrinsics/c99_functions.c for the benefit of platforms that aren't
> C99.  Has this policy changed recently?

I don't think there has ever been a such a hard policy. Yes,
c99_functions.c provides _some_ C99 functions when they can be
implemented in terms of other available functions. E.g. sqrtf() is
provided by

#ifndef HAVE_SQRTF
#define HAVE_SQRTF 1
float sqrtf (float x);

float
sqrtf (float x)
{
  return (float) sqrt (x);
}
#endif

Obviously, sqrtl() could be provided in the same way using the C89
sqrt(), but I'm sure we all agree that would be a pretty crappy
implementation. I think it's better to leave it out than to give users
a false impression that they have a functioning sqrtl.

> I don't think it's a good idea for libgfortran to contain references to
> nonexistant functions (or for gfortran to emit references to C99
> functions on non-C99 platforms, if that's the case).  At least that's
> not what any other GCC language frontend does.

So what would be a good solution then, assuming Santa doesn't suddenly
provide us with a target-independent C99 math library? One solution, I
suppose, would be to not support real(kind=10) (C long double) on
non-C99 targets. Do we have some mechanism for determining this when
building the frontend?


-- 
Janne Blomqvist

  reply	other threads:[~2011-11-08 16:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05 21:09 Tobias Burnus
2011-11-07 21:00 ` Eric Botcazou
2011-11-07 21:05   ` Steve Kargl
2011-11-08 10:33     ` Rainer Orth
2011-11-08 15:41       ` Steve Kargl
2011-11-08 16:23         ` Rainer Orth
2011-11-08 16:34           ` Janne Blomqvist [this message]
2011-11-08 16:58             ` Tobias Burnus
2011-11-08 16:34           ` Steve Kargl
2011-11-08 18:56 Dominique Dhumieres
2011-11-08 19:20 ` Steve Kargl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO9iq9HUVa_fioe=EDuK5s8fW9Tunpncb5FAZoPp_oGu30QTBg@mail.gmail.com' \
    --to=blomqvist.janne@gmail.com \
    --cc=burnus@net-b.de \
    --cc=ebotcazou@adacore.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    --cc=sgk@troutmask.apl.washington.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).