This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Merge DEF_GOACC_BUILTIN into DEF_GOMP_BUILTIN? (was: OpenACC middle end changes)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 Jul 2015 17:58:37 +0200
- Subject: Re: Merge DEF_GOACC_BUILTIN into DEF_GOMP_BUILTIN? (was: OpenACC middle end changes)
- Authentication-results: sourceware.org; auth=none
- References: <87fvdnnijk dot fsf at schwinge dot name> <20141113180949 dot GX5026 at tucnak dot redhat dot com> <87io9t49cb dot fsf at kepler dot schwinge dot homeip dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jul 09, 2015 at 05:52:20PM +0200, Thomas Schwinge wrote:
> --- gcc/builtins.def
> +++ gcc/builtins.def
> @@ -182,7 +182,9 @@ along with GCC; see the file COPYING3. If not see
> #define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
> DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
> false, true, true, ATTRS, false, \
> - (flag_openmp || flag_tree_parallelize_loops \
> + (flag_openmp \
> + || flag_tree_parallelize_loops > 1 \
> + || flag_cilkplus \
> || flag_offload_abi != OFFLOAD_ABI_UNSET))
>
> /* Builtin used by implementation of Cilk Plus. Most of these are decomposed
>
> Before this patch, all DEF_GOMP_BUILTINs (erroneously) had always been
> available, due to flag_tree_parallelize_loops's default value of 1.
>
> With gcc/omp-low.c:lower_reduction_clauses using a
> BUILT_IN_GOMP_ATOMIC_START/BUILT_IN_GOMP_ATOMIC_END sequence as a last
> resort, and that being chosen for some kind of OpenACC reduction clauses
> (which is present on gomp-4_0-branch only), we're then running into ICEs,
> as those two DEF_GOMP_BUILTINs are not available with plain -fopenacc.
>
> Now, it there actually a good reason to have separate DEF_GOACC_BUILTIN
> and DEF_GOMP_BUILTIN directives (which I basically just initially did to
> be "least intrusive",
> <http://news.gmane.org/find-root.php?message_id=%3C1383766943-8863-6-git-send-email-thomas%40codesourcery.com%3E>),
> or should I just add flag_openacc to DEF_GOMP_BUILTIN, and change all
> DEF_GOACC_BUILTIN instantiations to DEF_GOMP_BUILTIN? Merging them
> definitely makes sense to me now, so OK to do the obvious?
Having DEF_GOMP_BUILTIN and DEF_GOACC_BUILTIN is nice, it tells you
if it is OpenMP or OpenACC builtin. I'd say just add || flag_openacc
to DEF_GOMP_BUILTIN if you need it. E.g. for -ftree-parallelize-loops
or -fcilkplus I doubt you want the OpenACC builtins ;).
Jakub