From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72678 invoked by alias); 18 Jan 2019 20:01:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 72467 invoked by uid 89); 18 Jan 2019 20:01:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=D*apl.washington.edu, D*washington.edu, D*troutmask.apl.washington.edu, sgktroutmaskaplwashingtonedu X-HELO: mail-qk1-f178.google.com Received: from mail-qk1-f178.google.com (HELO mail-qk1-f178.google.com) (209.85.222.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Jan 2019 20:01:10 +0000 Received: by mail-qk1-f178.google.com with SMTP id 68so8730375qke.9 for ; Fri, 18 Jan 2019 12:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iastate.edu; s=google20150603; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LQD32tEGh9XJJh1MgGTUT5wrb2hXHzoKTWtsYkIN28E=; b=KiW/rp95n6N22BDhi3QnGFIeFU2+wh/thKZJexJZzWye8PqNjRzkWwvENzMz+DocdI Kfr4LwZ4LTcQWM9MrG1+Rsa1r4Tw8FnzheZn1gq6I9AxPVl7cGUzd45dta8rIvk/fFiQ Ov0p3M+YODSRX/B8MyJIPeThiiySIuoh/Wsbc= MIME-Version: 1.0 References: <20190118192735.GA67784@troutmask.apl.washington.edu> In-Reply-To: <20190118192735.GA67784@troutmask.apl.washington.edu> From: Nathan Weeks Date: Fri, 18 Jan 2019 20:01:00 -0000 Message-ID: Subject: Re: [PATCH,Fortran][RFC] PR 87939, 87326 - STAT= and ERRMSG= specifiers in several image control statements; NEW_INDEX= specifier in FORM TEAM statement To: sgk@troutmask.apl.washington.edu Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-01/txt/msg01099.txt.bz2 Hi Steve, URLs: done Copyright assignment: in progress. Thanks for the heads up regarding the wait. -- Nathan On Fri, Jan 18, 2019 at 1:27 PM Steve Kargl wrote: > > Nathan, > > Can you add URLs in the bug reports to your patch so > that it doesn't get lost? The copyright assignment > can take longer than one might think. > > -- > steve > > On Fri, Jan 18, 2019 at 01:17:03PM -0600, Nathan Weeks wrote: > > I made a mistake in the ChangeLogs: libgfortran.h is in gcc/fortran, > > and libcaf.h is in libgfortran/caf. Also, the additional enumerations > > in those headers don't go all the way in adding support for > > STAT_UNLOCKED_FAILED_IMAGE to ISO_FORTRAN_ENV itself (it looks like > > that would be at least a minor modification to > > gcc/fortran/iso-fortran-env.def, and documentation update in > > gcc/fortran/intrinsic.texi, and perhaps a test). I've updated the > > ChangeLogs to clarify all of this. > > > > -- > > Nathan > > > > frontend: > > > > 2019-01-16 Nathan Weeks > > > > PR fortran/87939 > > PR fortran/87326 > > * gfortran.h: Add an additional gfc_expr member to struct gfc_code. > > * libgfortran.h: Add GFC_STAT_UNLOCKED_FAILED_IMAGE. > > * match.c (gfc_match_critical): Add STAT= and ERRMSG=. > > (gfc_match_change_team): Likewise. > > (gfc_match_end_team): Likewise. > > (gfc_match_sync_team): Likewise. > > (gfc_match_form_team): Add STAT=, ERRMSG=, and NEW_INDEX=. > > * resolve.c (resolve_form_team): New. Type check team-variable > > argument in > > addition to new STAT= and ERRMSG= arguments. > > (resolve_change_sync_team): New. Adds type checking for team-value > > argument. > > (resolve_end_team): New. > > (resolve_critical): Add STAT= and ERRMSG=. > > * trans-decl.c (gfc_build_builtin_function_decls): Additional stat, > > errmsg, and errmsg_len arguments to _gfortran_caf_form_team(), > > _gfortran_caf_change_team(), _gfortran_caf_end_team(), and > > _gfortran_caf_sync_team(), and additional new_index argument to > > _gfortran_caf_form_team(). > > * trans-stmt.c (gfc_trans_form_team): Support STAT=, ERRMSG=, and > > NEW_INDEX=. > > (gfc_trans_change_team): Support STAT= and ERRMSG=. > > (gfc_trans_end_team): Likewise. > > (gfc_trans_sync_team): Likewise. > > (gfc_trans_critical): Likewise. Also support assigning STAT_FAILED_IMAGE > > to a stat-variable. > > > > libgfortran: > > > > 2019-01-16 Nathan Weeks > > > > PR fortran/87939 > > * caf/libcaf.h: Add CAF_STAT_FAILED_IMAGE. > > > > testsuite: > > > > 2019-01-16 Nathan Weeks > > > > PR fortran/87939 > > PR fortran/87326 > > * gfortran.dg/coarray_critical_2.f90: New test > > * gfortran.dg/coarray_critical_3.f90: New test > > * gfortran.dg/coarray_critical_4.f90: New test > > * gfortran.dg/team_change_2.f90: New test > > * gfortran.dg/team_change_3.f90: New test > > * gfortran.dg/team_end_2.f90: New test > > * gfortran.dg/team_end_3.f90: New test > > * gfortran.dg/team_form_2.f90: New test > > * gfortran.dg/team_form_3.f90: New test > > * gfortran.dg/team_sync_1.f90: New test > > * gfortran.dg/team_sync_2.f90: New test > > > > -- > > Nathan > > > > On Wed, Jan 16, 2019 at 6:16 PM Nathan Weeks wrote: > > > > > > Hi all, > > > > > > To facilitate more complete Fortran 2018 failed images support, I'm > > > particularly interested in interested in seeing PR 87939 eventually > > > resolved (i.e., allow STAT= and ERRMSG= specifiers in FORM TEAM, > > > CHANGE TEAM, SYNC TEAM, END TEAM, and CRITICAL statements). To get the > > > ball rolling (I realize that the boat has been missed for this kind of > > > change in GCC 9 trunk), I've attempted the following patch (which, > > > since it was convenient to do while modifying FORM TEAM-related code, > > > also adds the NEW_INDEX= specifier to the FORM TEAM statement as > > > desired in PR 87326). > > > > > > This is the first gfortran patch I've attempted, and I certainly could > > > have made some noob mistakes, so verbose feedback would be > > > appreciated. > > > > > > A few comments: > > > > > > * In resolve.c, the newly-added functions that type check STAT= and > > > ERRMSG= arguments for FORM TEAM, CHANGE TEAM, and SYNC TEAM also add > > > (previously-absent) type checking for their TEAM_TYPE arguments. If > > > it's more appropriate, I could separate this change into its own PR. > > > > > > * The existing -fcoarray=lib implementation of CRITICAL acquires a > > > LOCK on a lock variable on image 1 (in the current team). However, a > > > CRITICAL statement stat-value of STAT_FAILED_IMAGE (i.e., the image > > > that enter the CRITICAL construct failed) is analogous to the LOCK > > > stat-value of STAT_UNLOCKED_FAILED_IMAGE (i.e., the image that > > > acquired the lock failed---see section 11.6.11 (7 & 10) in Fortran > > > 2018 draft N2146), whereas a LOCK STAT_FAILED_IMAGE means the image on > > > which the lock variable resides has failed (no analog in the CRITICAL > > > statement, which is oblivious to this underlying implementation). So > > > in addition to adding the stat value STAT_UNLOCKED_FAILED_IMAGE to > > > libgfortran.h & libcaf.h, I had CRITICAL swap a LOCK > > > STAT_UNLOCKED_FAILED_IMAGE for STAT_FAILED_IMAGE, and (perhaps > > > unimaginatively) a LOCK STAT_FAILED_IMAGE for > > > STAT_UNLOCKED_FAILED_IMAGE (which, while it has no defined meaning for > > > a CRITICAL statement, fits the definition of a "processor-dependent > > > value other than STAT_FAILED_IMAGE"). > > > > > > * A couple negative tests for syntax errors (coarray_critical_2.f90 & > > > team_end_2.f90) fail due to spurious "Error: Expecting END PROGRAM > > > statement at (1)" errors that are also emitted by gfortran 8.2.0 as > > > well. > > > > > > Thanks, > > > > > > -- > > > Nathan > > > > > > frontend: > > > > > > 2019-01-16 Nathan Weeks > > > > > > PR fortran/87939 > > > PR fortran/87326 > > > * gfortran.h: Add an additional gfc_expr member to struct gfc_code. > > > * libcaf.h: Add support for STAT_UNLOCKED_FAILED_IMAGE. > > > * match.c (gfc_match_critical): Add STAT= and ERRMSG=. > > > (gfc_match_change_team): Likewise. > > > (gfc_match_end_team): Likewise. > > > (gfc_match_sync_team): Likewise. > > > (gfc_match_form_team): Add STAT=, ERRMSG=, and NEW_INDEX=. > > > * resolve.c (resolve_form_team): New. Type check team-variable > > > argument in > > > addition to new STAT= and ERRMSG= arguments. > > > (resolve_change_sync_team): New. Adds type checking for team-value > > > argument. > > > (resolve_end_team): New. > > > (resolve_critical): Add STAT= and ERRMSG=. > > > * trans-decl.c (gfc_build_builtin_function_decls): Additional stat, > > > errmsg, and errmsg_len arguments to _gfortran_caf_form_team(), > > > _gfortran_caf_change_team(), _gfortran_caf_end_team(), and > > > _gfortran_caf_sync_team(), and additional new_index argument to > > > _gfortran_caf_form_team(). > > > * trans-stmt.c (gfc_trans_form_team): Support STAT=, ERRMSG=, and > > > NEW_INDEX=. > > > (gfc_trans_change_team): Support STAT= and ERRMSG=. > > > (gfc_trans_end_team): Likewise. > > > (gfc_trans_sync_team): Likewise. > > > (gfc_trans_critical): Likewise. Also support assigning STAT_FAILED_IMAGE > > > to a stat-variable. > > > > > > libgfortran: > > > > > > 2019-01-16 Nathan Weeks > > > > > > PR fortran/87939 > > > * libgfortran.h: Add support for STAT_UNLOCKED_FAILED_IMAGE > > > > > > testsuite: > > > > > > 2019-01-16 Nathan Weeks > > > > > > PR fortran/87939 > > > PR fortran/87326 > > > * gfortran.dg/coarray_critical_2.f90: New test > > > * gfortran.dg/coarray_critical_3.f90: New test > > > * gfortran.dg/coarray_critical_4.f90: New test > > > * gfortran.dg/team_change_2.f90: New test > > > * gfortran.dg/team_change_3.f90: New test > > > * gfortran.dg/team_end_2.f90: New test > > > * gfortran.dg/team_end_3.f90: New test > > > * gfortran.dg/team_form_2.f90: New test > > > * gfortran.dg/team_form_3.f90: New test > > > * gfortran.dg/team_sync_1.f90: New test > > > * gfortran.dg/team_sync_2.f90: New test > > -- > Steve > 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 > 20161221 https://www.youtube.com/watch?v=IbCHE-hONow