From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82827 invoked by alias); 13 Jun 2016 16:41:21 -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 82799 invoked by uid 89); 13 Jun 2016 16:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=1,9, jakubredhatcom, jakub@redhat.com, UD:php 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 13 Jun 2016 16:41:10 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bCUvD-00003o-Ii from Thomas_Schwinge@mentor.com ; Mon, 13 Jun 2016 09:41:07 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Mon, 13 Jun 2016 17:41:06 +0100 From: Thomas Schwinge To: Jakub Jelinek , Subject: Re: [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c In-Reply-To: <20160613144856.GR7387@tucnak.redhat.com> References: <87h9ddrlrx.fsf@hertz.schwinge.homeip.net> <877fdtqhde.fsf@hertz.schwinge.homeip.net> <20160613144856.GR7387@tucnak.redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 13 Jun 2016 16:41:00 -0000 Message-ID: <87mvmpoxd0.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-06/txt/msg00979.txt.bz2 Hi! On Mon, 13 Jun 2016 16:48:56 +0200, Jakub Jelinek wrote: > On Mon, Jun 13, 2016 at 04:43:25PM +0200, Thomas Schwinge wrote: > > On Wed, 01 Jun 2016 17:06:42 +0200, Thomas Schwinge wrote: > > > Here are the OpenACC bits of . > >=20 > > In the PR, Jakub clarified that all the missing other OMP_CLAUSE_* are = in > > fact all unreachable here. > > The "anything else" default case in fact now is just the non-clause > > OMP_CLAUSE_ERROR, so when adding a case for that one, we could then > > remove the default case, and thus get a compiler warning when new claus= es > > are added in the future, without handling them here. That makes sense = to > > me (would have made apparent much earlier the original problem of missi= ng > > handling for certain OMP_CLAUSE_*), but based on feedback received, it > > feels as if I'm the only supporter of such "defensive" programming > > paradigms? Any thoughts about that, ? > > [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nes= ted.c > Ok, [...] As posted, committed to trunk in r237386: commit be2a5a8e8ffd13c099d372c4fcc363d5cd3c83c2 Author: tschwinge Date: Mon Jun 13 16:37:29 2016 +0000 [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c =20=20=20=20 gcc/ PR middle-end/71373 * tree-nested.c (convert_nonlocal_omp_clauses) (convert_local_omp_clauses): Document missing OMP_CLAUSE_*. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237386 138bc75d-0d04-04= 10-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/tree-nested.c | 60 ++++++++++++++++++++++++++++++++++++++-------------= ---- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git gcc/ChangeLog gcc/ChangeLog index ff685b1..89098e7 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,5 +1,9 @@ 2016-06-13 Thomas Schwinge =20 + PR middle-end/71373 + * tree-nested.c (convert_nonlocal_omp_clauses) + (convert_local_omp_clauses): Document missing OMP_CLAUSE_*. + * tree-cfg.c (edge_to_cases_cleanup): Fix CASE_CHAIN typo. * tree.def (CASE_LABEL_EXPR): Likewise. =20 diff --git gcc/tree-nested.c gcc/tree-nested.c index 812f619..62cb01f 100644 --- gcc/tree-nested.c +++ gcc/tree-nested.c @@ -1203,17 +1203,29 @@ convert_nonlocal_omp_clauses (tree *pclauses, struc= t walk_stmt_info *wi) case OMP_CLAUSE_AUTO: break; =20 + /* OpenACC tile clauses are discarded during gimplification. */ case OMP_CLAUSE_TILE: - /* OpenACC tile clauses are discarded during gimplification, so we - don't expect to see anything here. */ - gcc_unreachable (); - + /* The following clause belongs to the OpenACC cache directive, which + is discarded during gimplification. */ case OMP_CLAUSE__CACHE_: - /* These clauses belong to the OpenACC cache directive, which is - discarded during gimplification, so we don't expect to see - anything here. */ - gcc_unreachable (); - + /* The following clauses are only allowed in the OpenMP declare simd + directive, so not seen here. */ + case OMP_CLAUSE_UNIFORM: + case OMP_CLAUSE_INBRANCH: + case OMP_CLAUSE_NOTINBRANCH: + /* The following clauses are only allowed on OpenMP cancel and + cancellation point directives, which at this point have already + been lowered into a function call. */ + case OMP_CLAUSE_FOR: + case OMP_CLAUSE_PARALLEL: + case OMP_CLAUSE_SECTIONS: + case OMP_CLAUSE_TASKGROUP: + /* The following clauses are only added during OMP lowering; nested + function decomposition happens before that. */ + case OMP_CLAUSE__LOOPTEMP_: + case OMP_CLAUSE__SIMDUID_: + case OMP_CLAUSE__GRIDDIM_: + /* Anything else. */ default: gcc_unreachable (); } @@ -1899,17 +1911,29 @@ convert_local_omp_clauses (tree *pclauses, struct w= alk_stmt_info *wi) case OMP_CLAUSE_AUTO: break; =20 + /* OpenACC tile clauses are discarded during gimplification. */ case OMP_CLAUSE_TILE: - /* OpenACC tile clauses are discarded during gimplification, so we - don't expect to see anything here. */ - gcc_unreachable (); - + /* The following clause belongs to the OpenACC cache directive, which + is discarded during gimplification. */ case OMP_CLAUSE__CACHE_: - /* These clauses belong to the OpenACC cache directive, which is - discarded during gimplification, so we don't expect to see - anything here. */ - gcc_unreachable (); - + /* The following clauses are only allowed in the OpenMP declare simd + directive, so not seen here. */ + case OMP_CLAUSE_UNIFORM: + case OMP_CLAUSE_INBRANCH: + case OMP_CLAUSE_NOTINBRANCH: + /* The following clauses are only allowed on OpenMP cancel and + cancellation point directives, which at this point have already + been lowered into a function call. */ + case OMP_CLAUSE_FOR: + case OMP_CLAUSE_PARALLEL: + case OMP_CLAUSE_SECTIONS: + case OMP_CLAUSE_TASKGROUP: + /* The following clauses are only added during OMP lowering; nested + function decomposition happens before that. */ + case OMP_CLAUSE__LOOPTEMP_: + case OMP_CLAUSE__SIMDUID_: + case OMP_CLAUSE__GRIDDIM_: + /* Anything else. */ default: gcc_unreachable (); } Gr=C3=BC=C3=9Fe Thomas