This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Merge DEF_GOACC_BUILTIN into DEF_GOMP_BUILTIN? (was: OpenACC middle end changes)


Hi!

On Thu, 13 Nov 2014 19:09:49 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Nov 13, 2014 at 05:59:11PM +0100, Thomas Schwinge wrote:
> >   * should gcc/oacc-builtins.def just be merged into
> >     gcc/omp-builtins.def;
> 
> Why not.  The reason why they aren't in gcc/builtins.def is that
> the Fortran FE doesn't source those, but OpenACC supports the same
> languages as OpenMP.

(We've done that,
<http://news.gmane.org/find-root.php?message_id=%3C871tnxubgm.fsf%40schwinge.name%3E>.)

Now, trying to merge trunk into gomp-4_0-branch, I've hit the "problem"
that Tom applied
<http://news.gmane.org/find-root.php?message_id=%3C5583E052.2050207%40mentor.com%3E>
in trunk r224745:

--- 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?


GrÃÃe,
 Thomas

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]