This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c
- From: Thomas Schwinge <thomas at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 Jun 2016 16:47:55 +0200
- Subject: Re: [PR middle-end/71373] Document missing OMP_CLAUSE_* in gcc/tree-nested.c
- Authentication-results: sourceware.org; auth=none
- References: <87h9ddrlrx dot fsf at hertz dot schwinge dot homeip dot net> <877fdtqhde dot fsf at hertz dot schwinge dot homeip dot net>
Hi!
On Mon, 13 Jun 2016 16:43:25 +0200, Thomas Schwinge <thomas@codesourcery.com> wrote:
> On Wed, 01 Jun 2016 17:06:42 +0200, Thomas Schwinge <thomas@codesourcery.com> wrote:
> > Here are the OpenACC bits of <http://gcc.gnu.org/PR71373>.
>
> 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 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?
That is, something like that:
--- gcc/tree-nested.c
+++ gcc/tree-nested.c
@@ -1225,8 +1225,9 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE__LOOPTEMP_:
case OMP_CLAUSE__SIMDUID_:
case OMP_CLAUSE__GRIDDIM_:
- /* Anything else. */
- default:
+ /* This non-clause should never be seen outside of the front
+ ends. */
+ case OMP_CLAUSE_ERROR:
gcc_unreachable ();
}
}
@@ -1933,8 +1934,9 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE__LOOPTEMP_:
case OMP_CLAUSE__SIMDUID_:
case OMP_CLAUSE__GRIDDIM_:
- /* Anything else. */
- default:
+ /* This non-clause should never be seen outside of the front
+ ends. */
+ case OMP_CLAUSE_ERROR:
gcc_unreachable ();
}
}
GrÃÃe
Thomas