From patchwork Wed Oct 9 08:56:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 281755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1D8DD2C0091 for ; Wed, 9 Oct 2013 19:56:53 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=kkfMmtRfmu7q4EoW hN05SRYOisbzqRos1oymRxSd1qBliTi0RkJ+GmYIMMq2RD9jJmCb6MuRptEoyHPL DfAcSJ/A6neg1CYJ65wlmZTwz353T+n2cmYIzJik6L4AtxCfFQS0o8pcnYqks3eC dEB9uzaf58ll90K5KgXzN1sTfts= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=W4hMNhcDNMutI589Zj1BOK ecr5A=; b=ypQMAtk6D5XF0cTuoeTI37VWyTecSJvUgIJBagM6x3f9m81/WlHiA4 +F33OUJF8rTLBRoeqp8BK/vC7qD4Nqs8ws8j2v/B5TeONzX3Yg/HVJVqMvmfITIG 2w/a5Q7dYAEic09hyrdYESOT5/O+cEe7erPok20zKEftClUjJSrcY= Received: (qmail 16156 invoked by alias); 9 Oct 2013 08:56:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 16144 invoked by uid 89); 9 Oct 2013 08:56:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Oct 2013 08:56:43 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VTpZP-0001bW-1V from Thomas_Schwinge@mentor.com ; Wed, 09 Oct 2013 01:56:39 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 9 Oct 2013 01:56:38 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Wed, 9 Oct 2013 09:56:36 +0100 From: Thomas Schwinge To: Jakub Jelinek CC: Subject: Re: Cleanup patches In-Reply-To: <20131008200423.GG30970@tucnak.zalov.cz> References: <877gdout80.fsf@schwinge.name> <20131008200423.GG30970@tucnak.zalov.cz> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Wed, 9 Oct 2013 10:56:25 +0200 Message-ID: <87r4buu8jq.fsf@schwinge.name> MIME-Version: 1.0 Hi! On Tue, 8 Oct 2013 22:04:23 +0200, Jakub Jelinek wrote: > On Tue, Oct 08, 2013 at 09:17:35AM +0200, Thomas Schwinge wrote: > > Here are a few cleanup patches, mostly in the realm of OpenMP, so Jakub > > gets a CC. OK to commit? > > They look ok to me, but I'd prefer if they could go in after the merge > I've just posted. Sure, I can wait until then. Meanwhile, here's another series that I assumed had gotten lost, but now recovered thanks to »git fsck«. Also OK to commit? _OPENMP pre-processor checks, openmp_version Fortran instrinsic checks. gcc/testsuite/ * c-c++-common/cpp/openmp-define-1.c: New file. * c-c++-common/cpp/openmp-define-2.c: Likewise. * c-c++-common/cpp/openmp-define-3.c: Likewise. * gfortran.dg/openmp-define-1.f90: Likewise. * gfortran.dg/openmp-define-2.f90: Likewise. * gfortran.dg/openmp-define-3.f90: Likewise. libgomp/ * testsuite/libgomp.fortran/openmp_version-1.f: New file. * testsuite/libgomp.fortran/openmp_version-2.f90: Likewise. --- gcc/testsuite/c-c++-common/cpp/openmp-define-1.c | 6 ++++++ gcc/testsuite/c-c++-common/cpp/openmp-define-2.c | 7 +++++++ gcc/testsuite/c-c++-common/cpp/openmp-define-3.c | 11 +++++++++++ gcc/testsuite/gfortran.dg/openmp-define-1.f90 | 7 +++++++ gcc/testsuite/gfortran.dg/openmp-define-2.f90 | 7 +++++++ gcc/testsuite/gfortran.dg/openmp-define-3.f90 | 11 +++++++++++ libgomp/testsuite/libgomp.fortran/openmp_version-1.f | 9 +++++++++ libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 | 9 +++++++++ 8 files changed, 67 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-1.c create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-2.c create mode 100644 gcc/testsuite/c-c++-common/cpp/openmp-define-3.c create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/openmp-define-3.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/openmp_version-1.f create mode 100644 libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 Grüße, Thomas diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-1.c gcc/testsuite/c-c++-common/cpp/openmp-define-1.c new file mode 100644 index 0000000..0e7943a --- /dev/null +++ gcc/testsuite/c-c++-common/cpp/openmp-define-1.c @@ -0,0 +1,6 @@ +/* { dg-require-effective-target fopenmp } */ +/* { dg-do preprocess } */ + +#ifdef _OPENMP +# error _OPENMP defined +#endif diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-2.c gcc/testsuite/c-c++-common/cpp/openmp-define-2.c new file mode 100644 index 0000000..f777789 --- /dev/null +++ gcc/testsuite/c-c++-common/cpp/openmp-define-2.c @@ -0,0 +1,7 @@ +/* { dg-require-effective-target fopenmp } */ +/* { dg-options "-fno-openmp" } */ +/* { dg-do preprocess } */ + +#ifdef _OPENMP +# error _OPENMP defined +#endif diff --git gcc/testsuite/c-c++-common/cpp/openmp-define-3.c gcc/testsuite/c-c++-common/cpp/openmp-define-3.c new file mode 100644 index 0000000..6ea0425 --- /dev/null +++ gcc/testsuite/c-c++-common/cpp/openmp-define-3.c @@ -0,0 +1,11 @@ +/* { dg-require-effective-target fopenmp } */ +/* { dg-options "-fopenmp" } */ +/* { dg-do preprocess } */ + +#ifndef _OPENMP +# error _OPENMP not defined +#endif + +#if _OPENMP != 201107 +# error _OPENMP defined to wrong value +#endif diff --git gcc/testsuite/gfortran.dg/openmp-define-1.f90 gcc/testsuite/gfortran.dg/openmp-define-1.f90 new file mode 100644 index 0000000..d4ef1d1 --- /dev/null +++ gcc/testsuite/gfortran.dg/openmp-define-1.f90 @@ -0,0 +1,7 @@ +! { dg-require-effective-target fopenmp } +! { dg-options "-cpp" } +! { dg-do preprocess } + +#ifdef _OPENMP +# error _OPENMP defined +#endif diff --git gcc/testsuite/gfortran.dg/openmp-define-2.f90 gcc/testsuite/gfortran.dg/openmp-define-2.f90 new file mode 100644 index 0000000..651dae7 --- /dev/null +++ gcc/testsuite/gfortran.dg/openmp-define-2.f90 @@ -0,0 +1,7 @@ +! { dg-require-effective-target fopenmp } +! { dg-options "-cpp -fno-openmp" } +! { dg-do preprocess } + +#ifdef _OPENMP +# error _OPENMP defined +#endif diff --git gcc/testsuite/gfortran.dg/openmp-define-3.f90 gcc/testsuite/gfortran.dg/openmp-define-3.f90 new file mode 100644 index 0000000..dfc45b1 --- /dev/null +++ gcc/testsuite/gfortran.dg/openmp-define-3.f90 @@ -0,0 +1,11 @@ +! { dg-require-effective-target fopenmp } +! { dg-options "-cpp -fopenmp" } +! { dg-do preprocess } + +#ifndef _OPENMP +# error _OPENMP not defined +#endif + +#if _OPENMP != 201107 +# error _OPENMP defined to wrong value +#endif diff --git libgomp/testsuite/libgomp.fortran/openmp_version-1.f libgomp/testsuite/libgomp.fortran/openmp_version-1.f new file mode 100644 index 0000000..aaa8881 --- /dev/null +++ libgomp/testsuite/libgomp.fortran/openmp_version-1.f @@ -0,0 +1,9 @@ +! { dg-do run } + + program main + implicit none + include "omp_lib.h" + + if (openmp_version .ne. 201107) call abort; + + end program main diff --git libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 new file mode 100644 index 0000000..b2d1d26 --- /dev/null +++ libgomp/testsuite/libgomp.fortran/openmp_version-2.f90 @@ -0,0 +1,9 @@ +! { dg-do run } + +program main + use omp_lib + implicit none + + if (openmp_version .ne. 201107) call abort; + +end program main libgomp/ * configure.ac: Typo fix. * configure: Regenerate. --- libgomp/configure | 2 +- libgomp/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git libgomp/configure.ac libgomp/configure.ac index d87ed29..e7fbb31 100644 --- libgomp/configure.ac +++ libgomp/configure.ac @@ -238,7 +238,7 @@ fi # See if we support thread-local storage. GCC_CHECK_TLS -# See what sort of export controls are availible. +# See what sort of export controls are available. LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT LIBGOMP_CHECK_ATTRIBUTE_ALIAS gcc/ * tree.h (OMP_CLAUSE_CODE): Remove duplicate definition. --- gcc/tree.h | 3 --- 1 file changed, 3 deletions(-) diff --git gcc/tree.h gcc/tree.h index a71cd96..2ecda8a 100644 --- gcc/tree.h +++ gcc/tree.h @@ -1351,9 +1351,6 @@ extern void protected_set_expr_location (tree, location_t); #define OMP_CLAUSE_SET_CODE(NODE, CODE) \ ((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE)) -#define OMP_CLAUSE_CODE(NODE) \ - (OMP_CLAUSE_CHECK (NODE))->omp_clause.code - #define OMP_CLAUSE_OPERAND(NODE, I) \ OMP_CLAUSE_ELT_CHECK (NODE, I) libgomp/ * testsuite/libgomp.c/lib-1.c (main): Add missing error check. * testsuite/libgomp.fortran/lib1.f90: Likewise. * testsuite/libgomp.fortran/lib2.f: Likewise. * testsuite/libgomp.fortran/lib3.f: Likewise. --- libgomp/testsuite/libgomp.c/lib-1.c | 2 ++ libgomp/testsuite/libgomp.fortran/lib1.f90 | 1 + libgomp/testsuite/libgomp.fortran/lib2.f | 1 + libgomp/testsuite/libgomp.fortran/lib3.f | 1 + 4 files changed, 5 insertions(+) diff --git libgomp/testsuite/libgomp.c/lib-1.c libgomp/testsuite/libgomp.c/lib-1.c index 4839cf93..086036d 100644 --- libgomp/testsuite/libgomp.c/lib-1.c +++ libgomp/testsuite/libgomp.c/lib-1.c @@ -85,6 +85,8 @@ main (void) l = ! omp_in_parallel (); #pragma omp parallel reduction (|:l) if (1) l = ! omp_in_parallel (); + if (l) + abort (); e = omp_get_wtime (); if (d > e) diff --git libgomp/testsuite/libgomp.fortran/lib1.f90 libgomp/testsuite/libgomp.fortran/lib1.f90 index 8840018..e7e1c74 100644 --- libgomp/testsuite/libgomp.fortran/lib1.f90 +++ libgomp/testsuite/libgomp.fortran/lib1.f90 @@ -66,6 +66,7 @@ !$omp parallel reduction (.or.:l) if (.true.) l = .not. omp_in_parallel () !$omp end parallel + if (l) call abort e = omp_get_wtime () if (d .gt. e) call abort diff --git libgomp/testsuite/libgomp.fortran/lib2.f libgomp/testsuite/libgomp.fortran/lib2.f index 7551082..20db04a 100644 --- libgomp/testsuite/libgomp.fortran/lib2.f +++ libgomp/testsuite/libgomp.fortran/lib2.f @@ -66,6 +66,7 @@ C$OMP END PARALLEL C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.) L = .NOT. OMP_IN_PARALLEL () C$OMP END PARALLEL + IF (L) CALL ABORT E = OMP_GET_WTIME () IF (D .GT. E) CALL ABORT diff --git libgomp/testsuite/libgomp.fortran/lib3.f libgomp/testsuite/libgomp.fortran/lib3.f index fa7b227..264a377 100644 --- libgomp/testsuite/libgomp.fortran/lib3.f +++ libgomp/testsuite/libgomp.fortran/lib3.f @@ -66,6 +66,7 @@ C$OMP END PARALLEL C$OMP PARALLEL REDUCTION (.OR.:L) IF (.TRUE.) L = .NOT. OMP_IN_PARALLEL () C$OMP END PARALLEL + IF (L) CALL ABORT E = OMP_GET_WTIME () IF (D .GT. E) CALL ABORT libgomp/ * libgomp.texi (Runtime Library Routines): C linkage, don't throw exceptions. --- libgomp/libgomp.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git libgomp/libgomp.texi libgomp/libgomp.texi index 2985128..f674293 100644 --- libgomp/libgomp.texi +++ libgomp/libgomp.texi @@ -132,6 +132,8 @@ three parts: Control threads, processors and the parallel environment. +They have C linkage, and don't throw exceptions. + @menu * omp_get_active_level:: Number of active parallel regions * omp_get_ancestor_thread_num:: Ancestor thread ID contrib/ * gcc_update (files_and_dependencies): Fix rule for libgomp/testsuite/Makefile.in. --- contrib/gcc_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git contrib/gcc_update contrib/gcc_update index bdf89c4..235c8a9 100755 --- contrib/gcc_update +++ contrib/gcc_update @@ -139,7 +139,7 @@ libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4 libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4 libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4 libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4 -libgomp/testsuite/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4 +libgomp/testsuite/Makefile.in: libgomp/testsuite/Makefile.am libgomp/aclocal.m4 libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4 libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4 libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4 libgomp/ * Makefile.am (omp_lib.mod): Streamline rule. * Makefile.in: Regenerate. --- libgomp/Makefile.am | 2 +- libgomp/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git libgomp/Makefile.am libgomp/Makefile.am index 2bc4986..8cdd6a0 100644 --- libgomp/Makefile.am +++ libgomp/Makefile.am @@ -76,7 +76,7 @@ LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ omp_lib_kinds.mod: omp_lib.mod : omp_lib.mod: omp_lib.f90 - $(FC) $(FCFLAGS) -fsyntax-only omp_lib.f90 + $(FC) $(FCFLAGS) -fsyntax-only $< fortran.lo: libgomp_f.h fortran.o: libgomp_f.h env.lo: libgomp_f.h