public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>, <gcc-patches@gcc.gnu.org>,
	<fortran@gcc.gnu.org>
Subject: Re: Negative arguments in OpenMP 'num_threads' clause etc.
Date: Thu, 06 Jun 2019 08:06:00 -0000	[thread overview]
Message-ID: <87tvd3gmte.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <20190529145245.GU19695@tucnak>

[-- Attachment #1: Type: text/plain, Size: 1981 bytes --]

Hi Jakub!

On Wed, 29 May 2019 16:52:45 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, May 29, 2019 at 04:42:14PM +0200, Thomas Schwinge wrote:
> > On Tue, 09 Apr 2019 17:51:46 +0200, I wrote:
> > > On Tue, 29 Nov 2016 17:47:08 -0800, Cesar Philippidis <cesar@codesourcery.com> wrote:
> > > > One notable difference between the trunk and gomp4 implementation of the
> > > > tile clause is that gomp4 errors on negative value tile arguments,
> > > > whereas trunk issues warnings.

> > > > Is there a reason why the fortran FE
> > > > generally emits a warning, on say num_threads(-5), instead of an error?
> > > 
> > > Same for the C/C++ front ends, which I'm looking into first.
> > > 
> > > Jakub, is the reason that even if the user is clearly doing something
> > > "strage" there, the compiler doesn't have a problem to continue
> > > compilation for 'num_threads(-5)', so it just emits a warning, but for
> > > example for 'collapse(-5)' is has to stop with an error, because it can't
> > > continue compilation in that case?  Or, is there a different reason for
> > > the many 'warning_at ([...], "[...] must be positive"' (C front end, for
> > > example), instead of using 'error_at' for these?
> 
> collapse has a constant expression argument and if the value is negative (or
> 0), then parsing doesn't make sense, so that case is clearly something where
> an error is in order.  num_threads is an example of where the standard is
> not completely clear if it is or is not ok to reject compilation as opposed
> to just UB at runtime if that happens and no problem if that construct is
> never encoutered at runtime.

Thanks, so that matches my understanding, and we shall thus retract the
OpenACC "update gfortran's tile clause error handling" patch, that got
posted several times in several variations.


Later, we shall audit all front end clauses handling to make sure that
this is done consistently.


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

      parent reply	other threads:[~2019-06-06  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 14:07 [gomp4] update gfortran's tile clause error handling Cesar Philippidis
2016-10-03 14:35 ` Nathan Sidwell
     [not found] ` <87a13495-a378-b5e1-8223-0f5679f98356@mentor.com>
     [not found]   ` <20161111103441.GY3541@tucnak.redhat.com>
     [not found]     ` <cbe5aca8-77c5-0057-1381-4a99e43b4318@codesourcery.com>
     [not found]       ` <20161118112451.GW3541@tucnak.redhat.com>
     [not found]         ` <7467e478-cee5-b694-2988-e6887f25fa17@codesourcery.com>
2018-08-07 21:47           ` [PATCH][OpenACC] " Cesar Philippidis
2018-12-04 14:47             ` Jakub Jelinek
     [not found]             ` <87d0lvgorx.fsf@euler.schwinge.homeip.net>
     [not found]               ` <87k1e9iapl.fsf@euler.schwinge.homeip.net>
     [not found]                 ` <20190529145245.GU19695@tucnak>
2019-06-06  8:06                   ` Thomas Schwinge [this message]

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=87tvd3gmte.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).