[PATCH] Fix OpenACC vector_length parsing in fortran

2016-07-14 Thread Cesar Philippidis
-14 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * openmp.c (gfc_match_omp_clauses): Scan for clause vector_length before vector. gcc/testsuite/ * gfortran.dg/goacc/vector_length.f90: New test. diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 865e0d9..b70ff3e

Re: [PATCH] zero-length arrays in OpenACC

2016-07-14 Thread Cesar Philippidis
Ping, x2. Cesar On 06/01/2016 02:35 PM, Cesar Philippidis wrote: > This patch teaches c and c++ front ends and omp-low how to deal with > subarray involving GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} data > mappings. As the libgomp test case shows, it might be possible for a > subarray

[PATCH] Remove struct map from plugin-nvptx

2016-07-12 Thread Cesar Philippidis
tps://gcc.gnu.org/ml/gcc-patches/2015-12/msg01658.html>. Is this OK for trunk? Cesar 2016-07-12 Cesar Philippidis <ce...@codesourcery.com> James Norris <jnor...@codesourcery.com> libgomp/ * plugin/plugin-nvptx.c (struct map): Delete. (map_pop): Remove use of struct map. (map_push):

[gomp4] backport fixes for PR71704

2016-07-12 Thread Cesar Philippidis
This patch contains both Jakub's OpenMP and my OpenACC fixes for PR71704. For reference, the discussion for the original patches can be found here <https://gcc.gnu.org/ml/gcc-patches/2016-06/msg02084.html>. I'll apply this patch to gomp-4_0-branch shortly. Cesar 2016-07-12 Cesar Phili

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 10:25 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:58:57AM -0700, Cesar Philippidis wrote: >>>> +#define matcha(keyword, subr, st) \ >>>> +do { \ >>>> +

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 09:31 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:19:01AM -0700, Cesar Philippidis wrote: >> 2016-07-08 Cesar Philippidis <ce...@codesourcery.com> >> >> gcc/fortran/ >> * parse.c (matcha): Define. >> (decode_oacc_dire

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 09:18 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:13:50AM -0700, Cesar Philippidis wrote: >> On 06/30/2016 10:47 AM, Jakub Jelinek wrote: >> >>> The Fortran parser apparently relies in functions that have still undecide

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 06/30/2016 10:47 AM, Jakub Jelinek wrote: > The Fortran parser apparently relies in functions that have still undecided > kind of the result that ST_GET_FCN_CHARACTERISTICS artificial statement is > returned before any executable statements in the function. > In normal statements that is

[PATCH] OpenACC routines in fortran modules

2016-07-01 Thread Cesar Philippidis
support for intrinsic procedures. So I can drop that part of the patch if necessary. Cesar 2016-07-01 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * gfortran.h (enum oacc_function): Define. (oacc_function_type): Declare. (symbol_attribute): Change the type of oacc_functio

[gomp4] backport fortran FE error handling changes

2016-07-01 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch which backports the recent error handling changes I made to the fortran FE. The discussion for the original patch for trunk can be found in this thread <https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00474.html>. 2016-07-01 Cesar Philippidi

[PATCH] error on missing LTO symbols

2016-07-01 Thread Cesar Philippidis
was originally posted last year: <https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02076.html>. I was trying to avoid it for OpenACC, but making non-acc routine calls errors would complicate library functions. Cesar 2016-07-01 Cesar Philippidis <ce...@codesourcery.com> gcc/ *

Re: [PATCH,openacc] check for compatible loop parallelism with acc routine calls

2016-06-29 Thread Cesar Philippidis
utines in fortran modules (which I noticed was missing when I added 'acc routine seq' to acc_on_device in the fortran openacc include files). I'll split these into separate patches. > On Thu, 23 Jun 2016 09:05:38 -0700, Cesar Philippidis > <ce...@codesourcery.com> wrote: >> On

Re: OpenACC wait clause

2016-06-27 Thread Cesar Philippidis
On 06/27/2016 12:23 PM, Jakub Jelinek wrote: > On Mon, Jun 27, 2016 at 11:36:26AM -0700, Cesar Philippidis wrote: >> @@ -630,9 +653,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t >> mask, >> { >>gfc_omp_clauses *c = gfc_get_omp_clauses (); >

Re: OpenACC wait clause

2016-06-27 Thread Cesar Philippidis
On 06/24/2016 08:53 AM, Jakub Jelinek wrote: > On Fri, Jun 24, 2016 at 08:42:49AM -0700, Cesar Philippidis wrote: >>>> @@ -1328,7 +1328,8 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, >>>> uint64_t mask, >>>> && gfc_match ("wait

Re: OpenACC wait clause

2016-06-24 Thread Cesar Philippidis
On 06/17/2016 07:34 AM, Jakub Jelinek wrote: > On Thu, Jun 16, 2016 at 08:22:29PM -0700, Cesar Philippidis wrote: >> --- a/gcc/fortran/openmp.c >> +++ b/gcc/fortran/openmp.c >> @@ -677,7 +677,6 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t >> mask, >>

Re: [PATCH,openacc] check for compatible loop parallelism with acc routine calls

2016-06-23 Thread Cesar Philippidis
On 06/17/2016 07:42 AM, Jakub Jelinek wrote: > On Wed, Jun 15, 2016 at 08:12:15PM -0700, Cesar Philippidis wrote: >> The second set of changes involves teaching the gimplifier to error when >> it detects a function call to an non-acc routines inside an OpenACC >> offloade

[openacc] clean up acc directive matching in fortran

2016-06-16 Thread Cesar Philippidis
This patch introduces a match_acc function to the fortran FE. It's almost identical to match_omp, but it passes openacc = true to gfc_match_omp_clauses. I supposed I could have consolidated those two functions, but they are reasonably simple so I left them separate. Maybe a follow up patch can

Re: [openacc] clean up acc directive matching in fortran

2016-06-16 Thread Cesar Philippidis
On 06/16/2016 08:30 PM, Cesar Philippidis wrote: > This patch introduces a match_acc function to the fortran FE. It's > almost identical to match_omp, but it passes openacc = true to > gfc_match_omp_clauses. I supposed I could have consolidated those two > functions, but they are reaso

Re: OpenACC wait clause

2016-06-16 Thread Cesar Philippidis
On 06/07/2016 08:02 AM, Jakub Jelinek wrote: > On Tue, Jun 07, 2016 at 08:01:10AM -0700, Cesar Philippidis wrote: >> On 06/07/2016 04:13 AM, Jakub Jelinek wrote: >> >>> I've noticed >>> if ((mask & OMP_CLAUSE_WAIT) >>> &am

[PATCH,openacc] check for compatible loop parallelism with acc routine calls

2016-06-15 Thread Cesar Philippidis
-by-reference in general. Cesar 2016-06-15 Cesar Philippidis <ce...@codesourcery.com> gcc/ * cgraphunit.c (ipa_passes): Only stream offloaded code when flag_generate_offload is positive. (symbol_table::compile): Likewise. * common.opt (flag_generate_offload): Update comment on its

Re: [PATCH, ping] zero-length arrays in OpenACC

2016-06-15 Thread Cesar Philippidis
Ping. Cesar On 06/01/2016 02:35 PM, Cesar Philippidis wrote: > This patch teaches c and c++ front ends and omp-low how to deal with > subarray involving GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} data > mappings. As the libgomp test case shows, it might be possible for a > subarray

Re: OpenACC wait clause

2016-06-07 Thread Cesar Philippidis
On 06/07/2016 04:13 AM, Jakub Jelinek wrote: > I've noticed > if ((mask & OMP_CLAUSE_WAIT) > && !c->wait > && gfc_match ("wait") == MATCH_YES) > { > c->wait = true; > match_oacc_expr_list (" (", >wait_list, false); >

[PATCH] zero-length arrays in OpenACC

2016-06-01 Thread Cesar Philippidis
not to handle GOMP_MAP_POINTER, because subarray pointers are now firstprivate. Is this OK for trunk? Cesar 2016-06-01 Cesar Philippidis <ce...@codesourcery.com> gcc/c/ * c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. * c-typeck.c (handle_omp_array_sections): Mar

[PATCH] add a test case for PR70688

2016-06-01 Thread Cesar Philippidis
I had already fixed pr70688 in trunk r236678 with the patch I introduced here <https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00762.html>. This patch introduces a new libgomp test case to verify the fix. I'll apply this patch to trunk and gomp4 as obvious. Cesar 2016-06-01 Cesar Philippidi

Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-06-01 Thread Cesar Philippidis
On 05/25/2016 09:33 AM, Thomas Schwinge wrote: >> --- gcc/c/c-parser.c >> +++ gcc/c/c-parser.c >> @@ -13602,6 +13602,7 @@ c_parser_oacc_declare (c_parser *parser) >> >>switch (OMP_CLAUSE_MAP_KIND (t)) >> { >> +case GOMP_MAP_FIRSTPRIVATE_POINTER: >> case

Re: Remove the unused OMP_CLAUSE_DEVICE_RESIDENT

2016-05-31 Thread Cesar Philippidis
On 05/31/2016 08:45 AM, Thomas Schwinge wrote: > While working on something else, I came across the following. Cesar, can > you please verify that this is really dead code in the Fortran front end, > which currently is the only producer of OMP_CLAUSE_DEVICE_RESIDENT? You're correct. Declare

[gomp4] backport firstprivate subarray changes

2016-05-27 Thread Cesar Philippidis
changes. Cesar 2016-05-27 Cesar Philippidis <ce...@codesourcery.com> gcc/testsuite/ * c-c++-common/goacc/kernels-loop-offload-alias-none.c: Add xfails. * c-c++-common/goacc/kernels-loop-offload-alias-ptr.c: Likewise. * c-c++-common/goacc/kernels-offload-alias-2.c: Likewise. * c-c++-

[gomp4] backport gfc_match_omp_clauses restructuring changes

2016-05-27 Thread Cesar Philippidis
This patch backports the gfc_match_omp_clauses restructuring changes that occurred early this month in trunk to gomp-4_0-branch. Now it's easier to detect which of our local changes in gomp4 are not present in trunk yet. Cesar 2016-05-27 Cesar Philippidis <ce...@codesourcery.com> Ba

[gomp4] fix bootstrap failure in oacc_loop_auto_partitions

2016-05-27 Thread Cesar Philippidis
This patch fixes a bootstrap failure that I encountered while backporting the firstprivate subarray patch to gomp-4_0-branch. I've applied it to gomp4. Cesar 2016-05-27 Cesar Philippidis <ce...@codesourcery.com> * gcc/omp-low.c (oacc_loop_auto_partitions): Use boolean OR when com

Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-24 Thread Cesar Philippidis
On 05/23/2016 11:09 PM, Jakub Jelinek wrote: > On Mon, May 23, 2016 at 07:31:53PM -0700, Cesar Philippidis wrote: >> @@ -12559,7 +12560,7 @@ c_finish_omp_clauses (tree clauses, enum >> c_omp_region_type ort) >>t = OMP_CLAUSE_DECL (c); >>if

Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-23 Thread Cesar Philippidis
On 05/20/2016 02:42 AM, Jakub Jelinek wrote: > On Tue, May 10, 2016 at 01:29:50PM -0700, Cesar Philippidis wrote: >> @@ -5796,12 +5796,14 @@ tree >> finish_omp_clauses (tree clauses, enum c_omp_region_type ort) >> { >>bitmap_head generic_head, firstpri

[gomp4] backport the new sincos pattern

2016-05-23 Thread Cesar Philippidis
I've committed this patch to backport the new sincos pattern, which is enabled with -ffast-math, to gomp-4_0-branch. Cesar 2016-05-23 Cesar Philippidis <ce...@codesourcery.com> gcc/ * config/nvptx/nvptx.md (sincossf3): New pattern. gcc/testsuite/ * gcc.target/nvptx/sincos.c: Ne

Re: [ping][patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-19 Thread Cesar Philippidis
Ping. Cesar On 05/10/2016 01:29 PM, Cesar Philippidis wrote: > Pointers are special in OpenACC. Depending on the context, they can > either be treated as a "scalar" or as special firstprivate pointer. This > is in contrast to OpenMP target pointers, which are always treate

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Cesar Philippidis
On 05/19/2016 04:29 AM, Alexander Monakov wrote: > On Wed, 18 May 2016, Cesar Philippidis wrote: > Note that the documentation suggests using 'make_safe_from' to concisely > express conflict resolution: > >> diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.m

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-18 Thread Cesar Philippidis
On 05/18/2016 05:29 AM, Nathan Sidwell wrote: > On 05/17/16 17:30, Cesar Philippidis wrote: >> On 05/17/2016 02:22 PM, Andrew Pinski wrote: >>>> gcc.sum >>>> Tests that now fail, but worked before: >>>> >>>> nvptx-none-run: gcc.c-torture/e

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/17/2016 02:22 PM, Andrew Pinski wrote: > On Tue, May 17, 2016 at 2:10 PM, Cesar Philippidis > <ce...@codesourcery.com> wrote: >> On 05/13/2016 01:13 PM, Andrew Pinski wrote: >>> On Fri, May 13, 2016 at 12:58 PM, Richard Biener >>> <richard.guent...@gmai

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/13/2016 01:13 PM, Andrew Pinski wrote: > On Fri, May 13, 2016 at 12:58 PM, Richard Biener > <richard.guent...@gmail.com> wrote: >> On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis >> <ce...@codesourcery.com> wrote: >>> The cse_

inhibit the sincos optimization when the target has sin and cos instructions

2016-05-13 Thread Cesar Philippidis
pass to ignore sin, cos and cexpi instructions when the target can expand those calls. This yields a 6x speedup in 314.omriq from spec accel when running on Nvidia accelerators. Is this OK for trunk? Cesar 2016-05-13 Cesar Philippidis <ce...@codesourcery.com> gcc/ * tree-ssa-math-

[patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-10 Thread Cesar Philippidis
exhaustive though, but I did include a test case for OpenMP. It should be noted that I still need to update the behavior of subarray pointers in fortran. I'm just waiting until for the OpenMP 4.5 fortran changes to land in trunk first. Is this patch OK for trunk? Cesar 2016-05-10 Cesar Philip

[gomp4] backport fix for PR70626

2016-05-09 Thread Cesar Philippidis
is broken in gomp4, so I had to xfail it. Apparently, it exposed an async bug. My forthcoming patch which uses firstprivate pointers for subarrays should fix it. This patch has been committed to gomp-4_0-branch. Cesar 2016-05-09 Cesar Philippidis <ce...@codesourcery.com> Backport trunk r

[gomp4] backport the *finish_omp_clauses changes

2016-05-09 Thread Cesar Philippidis
2016-05-09 Cesar Philippidis <ce...@codesourcery.com> Backport trunk r235780: 2016-05-02 Cesar Philippidis <ce...@codesourcery.com> gcc/c-family/ * c-common.h (enum c_omp_region_type): Define. gcc/c/ * c-parser.c (c_parser_oacc_all_clauses): Update call to c_finish

[gomp4] backport fix for PR69363

2016-05-09 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch which backports some cilk changes in the c and c++ front ends to gomp-4_0-branch. These changes were necessary for my recent finish_omp_clauses patch, which I'll be committing next. Cesar 2016-05-09 Cesar Philippidis <ce...@codesourcery.com> Ba

Re: [patch] cleanup *finish_omp_clauses

2016-05-01 Thread Cesar Philippidis
was passing C_ORT_OMP instead of C_ORT_OMP_DECLARE_SIMD. I didn't look into this too deeply though. Is this patch OK for trunk? Cesar 2016-04-29 Cesar Philippidis <ce...@codesourcery.com> gcc/c-family/ * c-common.h (enum c_omp_region_type): Define. gcc/c/ * c-parser.c (c_parser_oacc_all_clauses):

Re: [ping][patch] update handling of 'acc parallel loop' reductions for PR70626

2016-04-28 Thread Cesar Philippidis
Ping. Cesar On 04/15/2016 02:30 PM, Cesar Philippidis wrote: > This patch makes the c, c++ and fortran FEs duplicate the reduction > clauses in a combined 'acc parallel loop' directive when it splits that > directive into separate parallel and loop directives. So given somethi

Re: [patch] cleanup *finish_omp_clauses

2016-04-28 Thread Cesar Philippidis
On 04/28/2016 01:56 AM, Jakub Jelinek wrote: > On Wed, Apr 27, 2016 at 07:37:17PM -0700, Cesar Philippidis wrote: >> This patch replaces all of the bool argument to c_finish_omp_clauses and >> finish_omp_clauses in the c and c++ front ends, respectively. Right now >> there are

[patch] cleanup *finish_omp_clauses

2016-04-27 Thread Cesar Philippidis
special handling in *finish_omp_clauses in the near future, too, so rather than add an is_oacc argument, I introduced an enum c_omp_region_type, similar to the one in gimplify.c. Is this patch ok for trunk? I'll make use of C_ORT_ACC shortly in a follow up patch. Cesar 2016-04-27 Cesar

[patch] fix openacc data clause errors in c/c++ for PR70688

2016-04-22 Thread Cesar Philippidis
, but I went with that because it seems like the thing to do here. Maybe it would be better if all of those arguments were consolidated into a single bitmask or enum? Is this OK for trunk and possibly gcc-6.2? Cesar 2016-04-21 Cesar Philippidis <ce...@codesourcery.com> gcc/c/ PR c/7068

[patch] update handling of 'acc parallel loop' reductions for PR70626

2016-04-15 Thread Cesar Philippidis
I re-enable that test coverage. Is this patch ok for gcc-6 and trunk? I bootstrapped and regression tested on x86_64-none-linux-gnu. Cesar 2016-04-15 Cesar Philippidis <ce...@codesourcery.com> gcc/c-family/ PR middle-end/70626 * c-common.h (c_oacc_split_loop_clauses): Add boolean ar

[patch] fix an openacc test case

2016-04-14 Thread Cesar Philippidis
. This problem only occurs on nvptx targets. I'll apply this patch to trunk as obvious. Cesar 2016-04-14 Cesar Philippidis <ce...@codesourcery.com> libgomp/ * testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Don't pass parameter variables to subroutines. diff --git a/libgomp/tes

[patch] fix an openacc reference-type reduction bug in PR70643

2016-04-13 Thread Cesar Philippidis
be non-integral constants. This patch fixes that problem and adds a new runtime test case. Is this patch ok for trunk? I tested it on x86_64-linux. Cesar 2016-04-13 Cesar Philippidis <ce...@codesourcery.com> gcc/ * omp-low.c (lower_oacc_reductions): Check for TREE_CONSTANT when bu

[patch] fix an openacc reduction test for PR68242

2016-04-13 Thread Cesar Philippidis
reduction-1.c because it can also overflow. This patch has been tested on i686-linux and x86_64-linux. I'll apply this patch to trunk as obvious shortly. Cesar 2016-04-13 Cesar Philippidis <ce...@codesourcery.com> libgomp/ PR testsuite/68242 * testsuite/libgomp.oacc-c-c++-common/reducti

[gomp4] backport parallel reduction changes

2016-04-11 Thread Cesar Philippidis
for trunk right now. I'll take a closer look at them later, but maybe we should drop them in gomp-4_0-branch. I've applied this patch to gomp-4_0-branch. Cesar 2016-04-08 Cesar Philippidis <ce...@codesourcery.com> gcc/ PR tree-optimization/70357 * gimplify.c (gimplify_scan_omp_clauses):

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 07:14 AM, Nathan Sidwell wrote: > On 04/08/16 00:40, Jakub Jelinek wrote: > >>> +/* OpenACC parallel reductions need a present_or_copy clause to ensure >>> + that the original variable used in the reduction gets updated on >>> + the host. Scan the list of clauses for reduction

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 12:40 AM, Jakub Jelinek wrote: > On Thu, Apr 07, 2016 at 09:34:43PM -0700, Cesar Philippidis wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -5802,7 +5802,8 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree >> decl, unsigned int flags)

Re: openacc reference reductions

2016-04-07 Thread Cesar Philippidis
nd then you can add the extra implicit clause and set > OMP_CLAUSE_MAP_IN_REDUCTION on it as appropriate. This new patch does that now. Is this patch OK for trunk? Cesar 2016-04-07 Cesar Philippidis <ce...@codesourcery.com> PR lto/70289 PR ipa/70348 PR tree-optimization/70373 PR midd

Re: openacc reference reductions

2016-04-06 Thread Cesar Philippidis
On 04/06/2016 07:23 AM, Jakub Jelinek wrote: > On Tue, Apr 05, 2016 at 06:53:47PM -0700, Cesar Philippidis wrote: >> --- a/gcc/omp-low.c >> +++ b/gcc/omp-low.c >> @@ -309,6 +309,25 @@ is_oacc_kernels (omp_context *ctx) >>== GF_OMP_TARGET_KIND_OACC_KERNELS)

Re: openacc reference reductions

2016-04-05 Thread Cesar Philippidis
On 02/22/2016 07:34 AM, Cesar Philippidis wrote: > Ping. This patch still needs a review. Ping. I've attached a rebased version of this patch. The omp-low.c bits haven't changed, but the test cases have since Thomas has been merging some of them from trunk. I separated the omp-low.c chan

Re: [patch] Fortran fix for PR70289

2016-04-04 Thread Cesar Philippidis
On 04/01/2016 08:17 AM, Jakub Jelinek wrote: > On Fri, Apr 01, 2016 at 08:07:24AM -0700, Cesar Philippidis wrote: >> On 04/01/2016 07:56 AM, Jakub Jelinek wrote: >>> On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote: >>>> The bug in PR70289 is

Re: [patch] Fortran fix for PR70289

2016-04-01 Thread Cesar Philippidis
On 04/01/2016 07:56 AM, Jakub Jelinek wrote: > On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote: >> The bug in PR70289 is an assertion failure triggered by a static >> variable used inside an offloaded acc region which doesn't have a data >> clause associat

[patch] Fortran fix for PR70289

2016-04-01 Thread Cesar Philippidis
t been properly declared. Cesar 2016-03-31 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * openmp.c (resolve_oacc_private_reductions): New function. (resolve_omp_clauses): Ensure that acc parallel reductions have a copy, pcopy or present clause associated with it, otherwise em

[gomp4] various backports from trunk

2016-03-11 Thread Cesar Philippidis
I've applied this patch which backports my recent trunk changes to gomp-4_0-branch. Specifically, this patch contains * nvptx vector state propagation fix, which includes the updated test fix for pr70009 * combined loop clauses fix Cesar 2016-03-11 Cesar Philippidis <

[PATCH] Fix PR7001

2016-03-10 Thread Cesar Philippidis
This patch updates a libgomp test case which was expecting char to be signed when that's not guaranteed to be the case. Jakub pre-approved this patch in the PR. I'll apply this patch to trunk and backport it to gomp-4_0-branch shortly. Cesar 2016-03-10 Cesar Philippidis <ce...@codesourcery.

[openacc] combined loop errors

2016-03-09 Thread Cesar Philippidis
incomplete fields. So updating the split clauses allows the compiler to gracefully error. Is this patch ok for trunk? It's specific to openacc. Thanks, Cesar 2016-03-09 Cesar Philippidis <ce...@codesourcery.com> gcc/c/ * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses when c

Re: [openacc] reference-typed data mappings

2016-02-22 Thread Cesar Philippidis
Ping. Cesar On 02/09/2016 09:05 AM, Cesar Philippidis wrote: > On 02/09/2016 07:00 AM, Cesar Philippidis wrote: >> On 02/01/2016 09:57 AM, Cesar Philippidis wrote: >> >>>> This patch fixes a couple of bugs preventing c++ reference-typed >>>> variabl

Re: openacc reference reductions

2016-02-22 Thread Cesar Philippidis
Ping. This patch still needs a review. Cesar On 02/09/2016 08:17 AM, Cesar Philippidis wrote: > On 02/09/2016 07:33 AM, Nathan Sidwell wrote: >> While I've not looked at the rest of the patch, this bit stood out: >> >>> +static bool >>> +is_oacc_parallel_redu

[openacc] vector state propagation

2016-02-22 Thread Cesar Philippidis
be able to broadcast the origin u32 register directly. Is there a better way to resolve this issue, or is this patch OK for trunk as-is? Cesar 2016-02-22 Cesar Philippidis <ce...@codesourcery.com> gcc/ * config/nvptx/nvptx.c (nvptx_gen_shuffle): Add support for QImode and HImode re

openacc reference reductions

2016-02-09 Thread Cesar Philippidis
separate pointers, I'd get SSA validation errors because those pointers get deferenced multiple times. I didn't investigate that problem further. Is this patch ok for trunk? Cesar 2016-02-09 Cesar Philippidis <ce...@codesourcery.com> gcc/ * omp-low.c (is_oacc_parallel_reduction

Re: [openacc] reference-typed data mappings

2016-02-09 Thread Cesar Philippidis
On 02/01/2016 09:57 AM, Cesar Philippidis wrote: > This patch fixes a couple of bugs preventing c++ reference-typed > variables from working in openacc data clauses. These fixes include: > > * Teach the gimplifier to filter out pointer data mappings for >OACC_DATA,

Re: openacc reference reductions

2016-02-09 Thread Cesar Philippidis
+ >> + return false; >> +} >> + Thanks for catching that. Those are artifacts from when this code used to be located exclusively in scan_sharing_clauses. I've updated the patch with those changes. Cesar 2016-02-09 Cesar Philippidis <ce...@codesourcery.com> gcc/ * omp-low.c (

Re: [openacc] reference-typed data mappings

2016-02-09 Thread Cesar Philippidis
On 02/09/2016 07:00 AM, Cesar Philippidis wrote: > On 02/01/2016 09:57 AM, Cesar Philippidis wrote: > >> > This patch fixes a couple of bugs preventing c++ reference-typed >> > variables from working in openacc data clauses. These fixes include: >> > >>

[openacc] reference-typed data mappings

2016-02-01 Thread Cesar Philippidis
test coverage or tell me what should be included? Is this patch ok for trunk? Cesar 2016-02-01 Cesar Philippidis <ce...@codesourcery.com> gcc/c/ * c-typeck.c (c_finish_omp_clauses): Report OMP_CLAUSE_MAP errors as data clause errors for OpenACC. gcc/cp/ * cp-tree.h (finish_omp_c

Re: [gomp4] fix c++ reference mappings in openacc

2016-01-20 Thread Cesar Philippidis
On 01/20/2016 07:46 PM, Cesar Philippidis wrote: > I've applied this patch to gomp-4_0-branch which fixes of problems > involving reference type variables in openacc data clauses. The first > problem was, the c++ front end was incorrectly handling reference types > in general in open

[gomp4] fix c++ reference mappings in openacc

2016-01-20 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch which fixes of problems involving reference type variables in openacc data clauses. The first problem was, the c++ front end was incorrectly handling reference types in general in openacc. Instead of mapping the variable, it would map the pointer to the

[gomp4] implicit non-scalars data mapping in kernels backport

2016-01-15 Thread Cesar Philippidis
hes/2016-01/msg00873.html>. Cesar 2016-01-15 Cesar Philippidis <ce...@codesourcery.com> gcc/ * gimplify.c (oacc_default_clause): Decode reference and pointer types for both kernels and parallel regions. libgomp/ * testsuite/libgomp.oacc-fortran/kernels-data.f90: New test. diff

Re: [openacc] implicit non-scalars data mapping in kernels

2016-01-14 Thread Cesar Philippidis
On 01/14/2016 06:18 AM, Nathan Sidwell wrote: > On 01/13/16 17:44, Jakub Jelinek wrote: >> On Wed, Jan 13, 2016 at 11:35:08PM +0100, Marek Polacek wrote: >>> On Wed, Jan 13, 2016 at 02:29:21PM -0800, Cesar Philippidis wrote: >>>> --- a/gcc/gimplify.c >>>

Re: [openacc] implicit non-scalars data mapping in kernels

2016-01-13 Thread Cesar Philippidis
On 01/13/2016 02:35 PM, Marek Polacek wrote: > On Wed, Jan 13, 2016 at 02:29:21PM -0800, Cesar Philippidis wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -5994,6 +5994,11 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, >> tree decl, unsigned fl

[openacc] implicit non-scalars data mapping in kernels

2016-01-13 Thread Cesar Philippidis
I noticed that there was already code in place to handle pointer types for parallel data mappings, so in this patch I moved that type extraction earlier so that both kernels and parallel regions can use it. Is this patch ok for trunk? Thanks, Cesar 2016-01-13 Cesar Philippidis <ce...@codesource

[gomp4] arrays inside modules

2016-01-12 Thread Cesar Philippidis
mp4 in an attempt to move all of the non-array descriptor array variables into the offloaded region. Applications, such as cloverleaf, sometimes have a lot of small offloaded regions, and treating those supplementary array variables as firstprivate caused a measurable I/O overhead. Cesar 2015-10-13 Ce

Re: [gomp4] private reductions

2016-01-11 Thread Cesar Philippidis
On 01/11/2016 04:10 AM, Thomas Schwinge wrote: > On Wed, 6 Jan 2016 19:55:02 -0800, Cesar Philippidis <ce...@codesourcery.com> > wrote: >> This patch updates the way that private reductions are handled in gomp4 >> to be more like trunk. > > Anything to commit to tr

Re: [gomp4] teach the lto driver to error for missing decls

2016-01-11 Thread Cesar Philippidis
On 01/11/2016 07:34 AM, Bernd Schmidt wrote: > On 01/08/2016 11:37 PM, Cesar Philippidis wrote: >> In openacc there are situations where a user may fail to mark a variable >> or function as offloadable (either using declare or routine). This patch >> makes the lto wrapper re

Re: [gomp4] private reductions

2016-01-08 Thread Cesar Philippidis
On 01/06/2016 07:55 PM, Cesar Philippidis wrote: > @@ -1384,26 +1331,9 @@ build_outer_var_ref (tree var, omp_context *ctx, bool > lastprivate = false) > x = build_simple_mem_ref (x); > } > } > - else if (is_oacc_parallel (ctx)) > -x = var; >

[gomp4] teach the lto driver to error for missing decls

2016-01-08 Thread Cesar Philippidis
In openacc there are situations where a user may fail to mark a variable or function as offloadable (either using declare or routine). This patch makes the lto wrapper reduce the missing decl assertion to an error. I've applied this patch to gomp-4_0-branch. Cesar 2016-01-08 Cesar Philippidis

[gomp4] reductions on explicitly private variables

2016-01-07 Thread Cesar Philippidis
t; 100; i++) v++; red[j] = v; } } This used to case a problem in lower_oacc_reductions because the reduction finalizer wasn't updating the correct variable. The attached patch fixes it. I've applied this patch to gomp-4_0-branch. Cesar 2016-01-07 Cesar Philippidi

Re: [gomp4] kernels offload fns

2016-01-06 Thread Cesar Philippidis
> + int level = oacc_fn_attrib_level (attrs); dims is dead and that's causing a bootstrap failure. I've applied this patch to gomp-4_0-branch to fix it. Cesar 2016-01-06 Cesar Philippidis <ce...@codesourcery.com> gcc/ * omp-low.c (new_oacc_loop_routine): Remove stale dims variable

[gomp4] private reductions

2016-01-06 Thread Cesar Philippidis
/routine-7.c libgomp.oacc-c/../libgomp.oacc-c-c++-common/declare-4.c I'll work on routine-7.c tomorrow. Jim, can you look at the declare-4.c failure? This patch has been applied to gomp-4_0-branch. Cesar 2016-01-06 Cesar Philippidis <ce...@codesourcery.com> PR other/68813 gcc/ * omp

Re: [gomp4] [WIP] OpenACC bind, nohost clauses

2015-12-16 Thread Cesar Philippidis
On 12/14/2015 12:36 PM, Cesar Philippidis wrote: > On 12/08/2015 11:55 AM, Thomas Schwinge wrote: >> On Sat, 14 Nov 2015 09:36:36 +0100, I wrote: >> C front end: >> >> --- gcc/c/c-parser.c >> +++ gcc/c/c-parser.c >> @@ -11607,6 +11607,8 @@ c_par

Re: [gomp4] [WIP] OpenACC bind, nohost clauses

2015-12-14 Thread Cesar Philippidis
On 12/08/2015 11:55 AM, Thomas Schwinge wrote: Just for clarification, we're implementing the bind clause with the semantics defined in OpenACC 2.5, correct? The 2.0a semantics aren't clear. > On Sat, 14 Nov 2015 09:36:36 +0100, I wrote: >> Initial support for the OpenACC bind and nohost clauses

Re: [gomp4] Fix Fortran deviceptr

2015-12-08 Thread Cesar Philippidis
On 12/08/2015 08:22 AM, James Norris wrote: >> 2. It appears that deviceptr code in GOACC_parallel_keyed is mostly >> identical to GOACC_data_start. Can you put that duplicate code into >> a function? That would be easier to maintain in the long run. >> > > Fixed. Where? I don't see

Re: [gomp4] Fix Fortran deviceptr

2015-12-07 Thread Cesar Philippidis
On 12/06/2015 06:52 AM, James Norris wrote: > This patch fixes a some runtime issues when dealing with > the deviceptr clause in Fortran. There were some corner > cases that were not being dealt with correctly, and the > patch resolves these. Also a new set of test cases has > been added. Which

[gomp4] more runtime test coverage

2015-12-04 Thread Cesar Philippidis
-branch. Some of the parallel tests could probably go into trunk, but that'll wait for some other time. Cesar 2015-12-04 Cesar Philippidis <ce...@codesourcery.com> libgomp/ * testsuite/libgomp.oacc-c-c++-common/{kernels-loop-4.c, kernels-private-vars-local-worker-1.c, kernels-private-vars

Re: [1/2] OpenACC routine support

2015-12-03 Thread Cesar Philippidis
ed by single > function"; that should be fixed up as well.) > >> Is this OK or do you prefer the "not followed by a single function" message? > > "not followed by a function declaration or definition" sounds good to me. Ok, I'll apply this patch in a coup

[gomp4] backport fortran array reduction changes

2015-12-03 Thread Cesar Philippidis
something to keep in mind next time you do a trunk merge. I've applied this patch to gomp-4_0-branch. Cesar 2015-12-03 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * openmp.c (gfc_match_omp_clauses): Allow subarrays for acc reductions. (resolve_omp_clauses): Error on any acc redu

Re: [OpenACC 0/7] host_data construct

2015-12-02 Thread Cesar Philippidis
ns containing array variables. Note that this solution is somewhat aggressive because we probably should allow reductions on individual array elements. E.g. !$acc loop reduction(+:var(1)) The c and c++ front ends also have that problem. Maybe I'll revisit this later. Is this ok for trunk? It w

Re: [OpenACC 0/7] host_data construct

2015-12-02 Thread Cesar Philippidis
On 12/02/2015 11:35 AM, Jakub Jelinek wrote: > On Wed, Dec 02, 2015 at 11:16:10AM -0800, Cesar Philippidis wrote: >>> --- gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 >>> +++ gcc/testsuite/gfortran.dg/goacc/coarray_2.f90 >>> @@ -3,6 +3,7 @@ >>> ! &g

Re: [1/2] OpenACC routine support

2015-12-02 Thread Cesar Philippidis
On 12/01/2015 06:49 AM, Cesar Philippidis wrote: > On 12/01/2015 06:40 AM, Thomas Schwinge wrote: > >> I noticed while working on other test cases: >> >> On Wed, 18 Nov 2015 11:02:01 -0800, Cesar Philippidis >> <ce...@codesourcery.com> wrote: >>> --

[gomp4] backport fortran gang parsing updates

2015-12-01 Thread Cesar Philippidis
constructs with the acc loop. That code was ifdef'ed out in gfc_filter_oacc_combined_clauses. I'll investigate this later. I've applied this patch to gomp-4_0-branch. Cesar 2015-12-01 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * dump-parse-tree.c (show_omp_clauses):

Re: [1/2] OpenACC routine support

2015-12-01 Thread Cesar Philippidis
On 12/01/2015 06:40 AM, Thomas Schwinge wrote: > I noticed while working on other test cases: > > On Wed, 18 Nov 2015 11:02:01 -0800, Cesar Philippidis > <ce...@codesourcery.com> wrote: >> --- a/gcc/cp/parser.c >> +++ b/gcc/cp/parser.c > >> @@ -1318,13 +

[openacc] fortran loop clauses and splitting

2015-11-30 Thread Cesar Philippidis
to kernels and parallel constructs. Now, they are only associated with the split acc loop. Is this OK for trunk? Cesar 2015-11-30 Cesar Philippidis <ce...@codesourcery.com> gcc/fortran/ * dump-parse-tree.c (show_omp_clauses): Handle optional num and static arguments for the gang

[gomp4] fortran routine backports

2015-11-30 Thread Cesar Philippidis
those changes. This patch has been applied to gomp-4_0-branch. Cesar 2015-11-30 Cesar Philippidis <ce...@codesourcery.com> gcc/ * tree-nested.c (convert_nonlocal_omp_clauses): Handle optional arguments for OMP_CLAUSE_{GANG,WORKER,VECTOR}. (convert_local_omp_clauses): Likewise gcc/tes

Re: [PR fortran/63858] Fix mix of OpenACC and OpenMP sentinels in continuations

2015-11-25 Thread Cesar Philippidis
if (flag_openacc || flag_openmp || flag_openmp_simd) > the ()s around are just misleading. > > Anyway, if the removal of "openmp_flag &&" is intentional, then > the patch is ok with the above mentioned changes. We can deal with the > cases

<    1   2   3   4   5   6   7   >