From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31208 invoked by alias); 13 Jun 2016 14:43: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 31127 invoked by uid 89); 13 Jun 2016 14:43:43 -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=Hx-languages-length:4248, supporter, cancel 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 14:43:32 +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 1bCT5N-0006jJ-Is from Thomas_Schwinge@mentor.com ; Mon, 13 Jun 2016 07:43:29 -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 15:43:28 +0100 From: Thomas Schwinge To: Jakub Jelinek , Subject: [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c In-Reply-To: <87h9ddrlrx.fsf@hertz.schwinge.homeip.net> References: <87h9ddrlrx.fsf@hertz.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 13 Jun 2016 14:43:00 -0000 Message-ID: <877fdtqhde.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/msg00965.txt.bz2 Hi! On Wed, 01 Jun 2016 17:06:42 +0200, Thomas Schwinge wrote: > Here are the OpenACC bits of . In the PR, Jakub clarified that all the missing other OMP_CLAUSE_* are in fact all unreachable here. OK to document this as follows, in trunk? 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 clauses are added in the future, without handling them here. That makes sense to me (would have made apparent much earlier the original problem of missing handling for certain OMP_CLAUSE_*), but based on feedback received, it feels as if I'm the only supporter of such "defensive" programming paradigms? commit c6b10a9bc1437395c4931d43f30e778152a28cb2 Author: Thomas Schwinge Date: Mon Jun 13 16:29:37 2016 +0200 [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c =20=20=20=20 gcc/ * tree-nested.c (convert_nonlocal_omp_clauses): (convert_local_omp_clauses): Document missing OMP_CLAUSE_*. --- gcc/tree-nested.c | 60 ++++++++++++++++++++++++++++++++++++++-------------= ---- 1 file changed, 42 insertions(+), 18 deletions(-) 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