From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130512 invoked by alias); 20 Oct 2015 09:37:44 -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 130489 invoked by uid 89); 20 Oct 2015 09:37:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 20 Oct 2015 09:37:42 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 238F4A8D; Tue, 20 Oct 2015 09:37:41 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9K9bcaU003267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Oct 2015 05:37:40 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id t9K9bbIV023074; Tue, 20 Oct 2015 11:37:37 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id t9K9bXm9023072; Tue, 20 Oct 2015 11:37:33 +0200 Date: Tue, 20 Oct 2015 09:41:00 -0000 From: Jakub Jelinek To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, i.usmanov@samsung.com, Ilmir Usmanov , cesar@codesourcery.com Subject: Re: [PR fortran/63858] Fix mix of OpenACC and OpenMP sentinels in continuations Message-ID: <20151020093733.GV478@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <3008431435623821@web14j.yandex.ru> <5591E54E.90509@ilmir.us> <5575ADD2.8030007@codesourcery.com> <87r3ntr8li.fsf@kepler.schwinge.homeip.net> <878u7cny9v.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878u7cny9v.fsf@kepler.schwinge.homeip.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01833.txt.bz2 On Fri, Oct 09, 2015 at 12:15:24PM +0200, Thomas Schwinge wrote: > diff --git gcc/fortran/scanner.c gcc/fortran/scanner.c > index bfb7d45..1e1ea84 100644 > --- gcc/fortran/scanner.c > +++ gcc/fortran/scanner.c > @@ -935,6 +935,63 @@ skip_free_comments (void) > return false; > } > > +/* Return true if MP was matched in fixed form. */ > +static bool > +skip_omp_attribute_fixed (locus *start) Technically, this isn't attribute, but sentinel. So, skip_fixed_omp_sentinel? I know the free functions are called attribute, perhaps we should rename them too, patch to do so preapproved. > +{ > + gfc_char_t c; > + if (((c = next_char ()) == 'm' || c == 'M') > + && ((c = next_char ()) == 'p' || c == 'P')) > + { > + c = next_char (); > + if (c != '\n' > + && (continue_flag The original code checked here (openmp_flag && continue_flag) instead. Is that change intentional? Looking around, we probably don't have a testcase coverage for say fixed form: C*OMP+PARALLEL DO do ... (i.e. where it starts with an OpenMP (or OpenACC) continuation, without non-continued line first), or for free form where: something & !$omp & parallel (ditto for OpenACC). > + while (gfc_is_whitespace (c)); > + if (c != '\n' && c != '!') > + { > + /* Canonicalize to *$omp. */ The comment has a pasto, by storing * you canonicalize to *$acc. > - if (flag_openacc) > + if (flag_openacc || (flag_openmp || flag_openmp_simd)) I'd just write if (flag_openacc || flag_openmp || flag_openmp_simd) the ()s around are just misleading. Anyway, if the removal of "openmp_flag &&" is intentional, then the patch is ok with the above mentioned changes. We can deal with the cases I've mentioned up above in a follow-up. Jakub