[Bug libgomp/88288] [OpenACC, libgomp] Adjust offsets for present data clauses

2018-11-30 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88288

--- Comment #2 from cesar at gcc dot gnu.org ---
Why not update goacc_parallel_keyed to use gomp_map_val instead computing
devaddrs manually? That would help reduce the number of duplicate mystery
formulas in libgomp.

[Bug fortran/77765] ICE in gfc_match_oacc_routine, at fortran/openmp.c:1781

2018-11-19 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77765

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from cesar at gcc dot gnu.org ---
This ICE is no longer present in trunk. Marking this as resolved.

[Bug fortran/72715] ICE in gfc_trans_omp_do, at fortran/trans-openmp.c:3164

2018-11-19 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72715

--- Comment #4 from cesar at gcc dot gnu.org ---
This is still broken in trunk. Mentor probably has a fix for it in og8, but
Thomas or someone else in their OpenACC team will need to port it over to
trunk.

[Bug middle-end/70828] broken array-type subarrays inside acc data in openacc

2018-11-19 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70828

--- Comment #4 from cesar at gcc dot gnu.org ---
I see that fix has been submitted to gomp-4_0-branch. Thomas, does Mentor have
any pending patches to resolve this in trunk, if it is still relevant?

[Bug testsuite/87064] [9 regression] libgomp.oacc-fortran/reduction-3.f90 fails starting with r263751

2018-08-24 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87064

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org,
   ||tschwinge at gcc dot gnu.org

--- Comment #6 from cesar at gcc dot gnu.org ---
I wasn't able to replicate this failure on an x86_64 target either with or
without nvptx offloading. It's like this is the vector reduction that's
failing:

  !$acc parallel vector_length(vl) copy(rv)
  !$acc loop reduction(max:rv) vector
  do i = 1, n
 rv = max (rv, array(i))
  end do
  !$acc end parallel


Maybe a reduction variable isn't being initialized properly. But that's strange
because on the host, all of the reductions are handled the same. That's not
true with nvptx.

I'll escalate this issue internally in Mentor.

[Bug middle-end/86757] New: [og8,nvptx] gangprivate related regressions

2018-07-31 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86757

Bug ID: 86757
   Summary: [og8,nvptx] gangprivate related regressions
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

The goacc_parlevel patches have been backported to openacc-gcc-8-branch in git
revision 6781e2dd99. For the most part, the patches applied cleanly, however, I
had to xfail the following tests in libgomp.oacc-c-c++-common because they fail
with -O0:

   loop-gwv-1.c
   loop-red-gwv-1.c
   loop-red-w-2.c

These tests work on trunk at -O0. I believe the problem was introduced with the
gangprivate patch. When I deactivated the gangprivate patch by modifying
nvptx.c:nvptx_goacc_expand_accel_var to always return NULL_RTX, those test
cases started passing.

I suspect this bug crept into og8 because those aforementioned tests were
originally skipped altogether at -O0 because they contained inline PTX assembly
code, which wasn't optimized away by the host compiler unless the program is
built with -O1 or greater. The goacc_parlevel changes replace the inline PTX
code with builtin functions that get expanded by the backend, which enables
those tests to run at -O0.

[Bug testsuite/86660] libgomp.c++/for-15.C ICEs with nvptx offloading

2018-07-25 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

--- Comment #9 from cesar at gcc dot gnu.org ---
(In reply to Tom de Vries from comment #8)

> Hmm, for me that minimizes to:
> ...
> extern "C" void abort ();
> 
> #pragma omp declare target
> int results[2000];
> #pragma omp end declare target
> 
> int
> main ()
> {
> #pragma omp target teams map (always, tofrom: results)
>   {
> results[75] = 1;
>   }
>   if (results[75] == 0)
> abort ();
> }
> ...

If omp declare target behaves like acc declare, wouldn't you still need to
update the host's copy of results? I'd expect results[75] to be zero outside of
the omp target region.

[Bug c++/86660] libgomp.c++/for-15.C ICEs with nvptx offloading

2018-07-24 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

--- Comment #1 from cesar at gcc dot gnu.org ---
Created attachment 44431
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44431=edit
LTO graceful abort patch

With the LTO graceful abort patch, I now see this error:

lto1: error: Missing ‘results’
lto1: fatal error: errors during merging of translation units
compilation terminated.
mkoffload: fatal error: x86_64-none-linux-gnu-accel-nvptx-none-gcc returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/openacc/trunk/install/libexec/gcc/x86_64-none-linux-gnu/9.0.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/openacc/trunk/install/lib/gcc/x86_64-none-linux-gnu/9.0.0/../../../../x86_64-none-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Why is results not being passed to the accelerator? Is it missing a target
declare or whatever its called in OpenMP?

[Bug c++/86660] New: libgomp.c++/for-15.C ICEs with nvptx offloading

2018-07-24 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

Bug ID: 86660
   Summary: libgomp.c++/for-15.C ICEs with nvptx offloading
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

I see the following ICE with libgomp.c++/for-15.C with nvptx-offloading:

lto1: internal compiler error: in input_varpool_node, at lto-cgraph.c:1393
0xc1d8d5 input_varpool_node
/openacc/trunk/gcc-mainline/gcc/lto-cgraph.c:1391
0xc1de1e input_cgraph_1
/openacc/trunk/gcc-mainline/gcc/lto-cgraph.c:1513
0xc1e9d5 input_symtab()
/openacc/trunk/gcc-mainline/gcc/lto-cgraph.c:1798
0x79d588 read_cgraph_and_symbols
/openacc/trunk/gcc-mainline/gcc/lto/lto.c:2917
0x79e9b8 lto_main()
/openacc/trunk/gcc-mainline/gcc/lto/lto.c:3400
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
mkoffload: fatal error: x86_64-none-linux-gnu-accel-nvptx-none-gcc returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/openacc/trunk/install/libexec/gcc/x86_64-none-linux-gnu/9.0.0//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/openacc/trunk/install/lib/gcc/x86_64-none-linux-gnu/9.0.0/../../../../x86_64-none-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

I think I've seen similar problems in OpenACC, so this might be fixed in og8
already.

[Bug tree-optimization/86263] [9 Regression] [nvptx] casesi, tablejump

2018-06-22 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86263

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #6 from cesar at gcc dot gnu.org ---
Created attachment 44311
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44311=edit
newlib test case

I attached a reduced test case from ecvtbuf.c. At Thomas mentioned, it's
failing with nvptx-gcc.

[Bug fortran/85703] [openacc] ICE in resolve_fntype, at fortran/resolve.c:16313

2018-06-15 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85703

--- Comment #6 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Jun 15 14:03:00 2018
New Revision: 261631

URL: https://gcc.gnu.org/viewcvs?rev=261631=gcc=rev
Log:
PR fortran/85703

Backport from mainline
2018-06-13  Cesar Philippidis  

PR fortran/85703

gcc/fortran/
* parse.c (decode_oacc_directive): Set gfc_matching_function
to false.
(decode_omp_directive): Likewise.

gcc/testsuite/
* gfortran.dg/goacc/pr85703.f90: New test.
* gfortran.dg/gomp/pr85703.f90: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/goacc/pr85703.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/gomp/pr85703.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/parse.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/85702] [openacc] ICE in gfc_format_decoder, at fortran/error.c:943

2018-06-15 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85702

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Jun 15 14:01:00 2018
New Revision: 261630

URL: https://gcc.gnu.org/viewcvs?rev=261630=gcc=rev
Log:
PR fortran/85702

Backport from mainline
2018-06-13  Cesar Philippidis  

PR fortran/85702

gcc/fortran/
* openmp.c (gfc_match_oacc_wait): Use %C to report error location.

gcc/testsuite/
* gfortran.dg/goacc/pr85702.f90: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/goacc/pr85702.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/openmp.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/85701] [openacc] ICE in mark_scope_block_unused, at tree-ssa-live.c:364

2018-06-15 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85701

--- Comment #5 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Jun 15 13:59:14 2018
New Revision: 261629

URL: https://gcc.gnu.org/viewcvs?rev=261629=gcc=rev
Log:
PR fortran/85701

Backport from mainline
2018-06-05  Cesar Philippidis  

PR fortran/85701

gcc/fortran/
* openmp.c (gfc_resolve_oacc_declare): Error on functions and
subroutine data clause arguments.

gcc/testsuite/
* gfortran.dg/goacc/pr85701.f90: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/goacc/pr85701.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/openmp.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/85703] [openacc] ICE in resolve_fntype, at fortran/resolve.c:16313

2018-06-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85703

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from cesar at gcc dot gnu.org ---
Fixed in trunk.

[Bug fortran/85702] [openacc] ICE in gfc_format_decoder, at fortran/error.c:943

2018-06-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85702

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from cesar at gcc dot gnu.org ---
Fixed in trunk.

[Bug fortran/85703] [openacc] ICE in resolve_fntype, at fortran/resolve.c:16313

2018-06-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85703

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Jun 13 14:31:17 2018
New Revision: 261551

URL: https://gcc.gnu.org/viewcvs?rev=261551=gcc=rev
Log:
PR fortran/85703

gcc/fortran/
* parse.c (decode_oacc_directive): Set gfc_matching_function
to false.
(decode_omp_directive): Likewise.

gcc/testsuite/
* gfortran.dg/goacc/pr85703.f90: New test.
* gfortran.dg/gomp/pr85703.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/goacc/pr85703.f90
trunk/gcc/testsuite/gfortran.dg/gomp/pr85703.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/parse.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/85702] [openacc] ICE in gfc_format_decoder, at fortran/error.c:943

2018-06-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85702

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Jun 13 14:29:04 2018
New Revision: 261550

URL: https://gcc.gnu.org/viewcvs?rev=261550=gcc=rev
Log:
PR fortran/85702

gcc/fortran/
* openmp.c (gfc_match_oacc_wait): Use %C to report error location.

gcc/testsuite/
* gfortran.dg/goacc/pr85702.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/goacc/pr85702.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/openmp.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/85701] [openacc] ICE in mark_scope_block_unused, at tree-ssa-live.c:364

2018-06-05 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85701

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||cesar at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #4 from cesar at gcc dot gnu.org ---
Fixed in trunk by having the Fortran FE error when function and subroutine are
used data clause arguments to acc declare.

[Bug fortran/85701] [openacc] ICE in mark_scope_block_unused, at tree-ssa-live.c:364

2018-06-05 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85701

--- Comment #3 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Tue Jun  5 13:58:50 2018
New Revision: 261202

URL: https://gcc.gnu.org/viewcvs?rev=261202=gcc=rev
Log:
PR fortran/85701

gcc/fortran/
* openmp.c (gfc_resolve_oacc_declare): Error on functions and
subroutine data clause arguments.

gcc/testsuite/
* gfortran.dg/goacc/pr85701.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/goacc/pr85701.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/openmp.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/85879] [6/7/8/9 Regression] ICE in expand_debug_locations, at cfgexpand.c:5405

2018-05-31 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85879

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu May 31 14:10:10 2018
New Revision: 261025

URL: https://gcc.gnu.org/viewcvs?rev=261025=gcc=rev
Log:
Fix PR middle-end/85879

gcc/
* gimplify.c (gimplify_adjust_omp_clauses): Add 'remove = true'
when emitting error on private/firstprivate reductions.
* omp-low.c (lower_omp_target): Avoid reference-type processing
on pointers for firstprivate clause.

gcc/testsuite/
* gfortran.dg/goacc/pr77371-1.f90: New test.
* gfortran.dg/goacc/pr77371-2.f90: New test.
* gfortran.dg/goacc/pr85879.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/goacc/pr77371-1.f90
trunk/gcc/testsuite/gfortran.dg/goacc/pr77371-2.f90
trunk/gcc/testsuite/gfortran.dg/goacc/pr85879.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/omp-low.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/85879] [6/7/8/9 Regression] ICE in expand_debug_locations, at cfgexpand.c:5405

2018-05-30 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85879

cesar at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||openacc

--- Comment #3 from cesar at gcc dot gnu.org ---
I'm testing Chung-Lin's fix for PR77371 from gomp-4_0-branch on trunk. It takes
extra care when handling data clauses of Fortran reference-type variables.

[Bug c++/85782] acc loops with continue statements ICE in c++

2018-05-18 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85782

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri May 18 15:46:56 2018
New Revision: 260370

URL: https://gcc.gnu.org/viewcvs?rev=260370=gcc=rev
Log:
PR c++/85782

Backport from mainline
2018-05-18  Cesar Philippidis  <ce...@codesourcery.com>

PR c++/85782

gcc/cp/
* cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for
OACC_LOOPs.

gcc/testsuite/
* c-c++-common/goacc/pr85782.c: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test.


Added:
branches/gcc-8-branch/gcc/testsuite/c-c++-common/goacc/pr85782.c
branches/gcc-8-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c
Modified:
branches/gcc-8-branch/gcc/cp/ChangeLog
branches/gcc-8-branch/gcc/cp/cp-gimplify.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/libgomp/ChangeLog

[Bug c++/85782] acc loops with continue statements ICE in c++

2018-05-18 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85782

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri May 18 15:43:09 2018
New Revision: 260369

URL: https://gcc.gnu.org/viewcvs?rev=260369=gcc=rev
Log:
PR c++/85782

gcc/cp/
* cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for
OACC_LOOPs.

gcc/testsuite/
* c-c++-common/goacc/pr85782.c: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/goacc/pr85782.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-gimplify.c
trunk/gcc/testsuite/ChangeLog
trunk/libgomp/ChangeLog

[Bug c++/85782] New: acc loops with continue statements ICE in c++

2018-05-14 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85782

Bug ID: 85782
   Summary: acc loops with continue statements ICE in c++
   Product: gcc
   Version: 8.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

Created attachment 44130
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44130=edit
test.cpp

G++ ICEs when it encounters OpenACC loops that contains continue statements as
demonstrated in the attached test case. Gcc, in contrast, does not suffer from
this defect.

This bug is present in GCC 6, 7, 8 and trunk.

[Bug fortran/85742] New: sizeof allocatable arrays returning wrong value

2018-05-10 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85742

Bug ID: 85742
   Summary: sizeof allocatable arrays returning wrong value
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

Created attachment 44113
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44113=edit
sizeof test

As of trunk revision 257065, the sizeof function is returning incorrect results
on assume-sized allocated arrays and scalars. See the attached test case for
more details.

I hit this problem while rebasing openacc-gcc-7-branch Fortran changes to GCC
8. Basically, OpenACC provides a Fortran module which contains an
acc_is_present routine, which passes the sizeof an array along with the pointer
to the array to the runtime to determine if that array is resident on the
device. However, now sizeof is returning bogus results.

[Bug target/85381] [og7, nvptx, openacc] parallel-loop-1.c fails with default vector length 128

2018-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85381

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #1 from cesar at gcc dot gnu.org ---
Strange. It passes for me using my GeForce 1070 running Nvidia driver 390.48.

[Bug middle-end/84955] [7/8 Regression] Incorrect OpenACC tile expansion

2018-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84955

--- Comment #6 from cesar at gcc dot gnu.org ---
I reverted that patch from trunk, and will revisit this issue during stage1.

It should be noted that GCC also chokes with any empty OpenACC loop in general.

[Bug middle-end/85383] [8 regression] many ICE failures at gcc/toplev.c:325 starting with r259346

2018-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85383

--- Comment #3 from cesar at gcc dot gnu.org ---
I ended up reverting the patch in r259351. It should be working now.

[Bug middle-end/85383] [8 regression] many ICE failures at gcc/toplev.c:325 starting with r259346

2018-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85383

--- Comment #1 from cesar at gcc dot gnu.org ---
I'm building a power8 toolchain right now. If the fix isn't immediately
obvious, I'll revert that patch for pr84955. After all, empty loops are
uninteresting in OpenACC.

[Bug middle-end/84955] [7/8 Regression] Incorrect OpenACC tile expansion

2018-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84955

--- Comment #5 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu Apr 12 13:15:45 2018
New Revision: 259346

URL: https://gcc.gnu.org/viewcvs?rev=259346=gcc=rev
Log:
PR middle-end/84955

gcc/
* lto-streamer-out.c (output_function): Fix CFG loop state before
streaming out.
* omp-expand.c (expand_oacc_for): Handle calls to internal
functions like regular functions.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test.
* testsuite/libgomp.oacc-fortran/pr84955.f90: New test.

Added:
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/pr84955.c
trunk/libgomp/testsuite/libgomp.oacc-fortran/pr84955.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lto-streamer-out.c
trunk/gcc/omp-expand.c
trunk/gcc/testsuite/ChangeLog

[Bug target/85056] [nvptx] wrong declaration of external arrays

2018-04-03 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

--- Comment #6 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Tue Apr  3 14:04:22 2018
New Revision: 259032

URL: https://gcc.gnu.org/viewcvs?rev=259032=gcc=rev
Log:
PR target/85056

Backport from mainline
2018-03-27  Cesar Philippidis  <ce...@codesourcery.com>

PR target/85056

gcc/
* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Add '[]' to
extern array declarations.

gcc/testsuite/
* testsuite/gcc.target/nvptx/pr85056.c: New test.
* testsuite/gcc.target/nvptx/pr85056a.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/nvptx/pr85056.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/nvptx/pr85056a.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/nvptx/nvptx.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/85056] [nvptx] wrong declaration of external arrays

2018-03-30 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

--- Comment #5 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Mar 30 15:47:23 2018
New Revision: 258978

URL: https://gcc.gnu.org/viewcvs?rev=258978=gcc=rev
Log:
PR target/85056

Backport from mainline
2018-03-27  Cesar Philippidis  <ce...@codesourcery.com>

PR target/85056

gcc/
* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Add '[]' to
extern array declarations.

gcc/testsuite/
* testsuite/gcc.target/nvptx/pr85056.c: New test.
* testsuite/gcc.target/nvptx/pr85056a.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/nvptx/pr85056.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/nvptx/pr85056a.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/nvptx/nvptx.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/85056] [nvptx] wrong declaration of external arrays

2018-03-27 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from cesar at gcc dot gnu.org ---
Fixed in trunk r258885 and openacc-gcc-7-branch 365d31be00.

[Bug target/85056] [nvptx] wrong declaration of external arrays

2018-03-27 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

--- Comment #3 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Tue Mar 27 13:54:03 2018
New Revision: 258885

URL: https://gcc.gnu.org/viewcvs?rev=258885=gcc=rev
Log:
PR target/85056

gcc/
* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Add '[]' to
extern array declarations.

gcc/testsuite/
* testsuite/gcc.target/nvptx/pr85056.c: New test.
* testsuite/gcc.target/nvptx/pr85056a.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/nvptx/pr85056.c
trunk/gcc/testsuite/gcc.target/nvptx/pr85056a.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/nvptx/nvptx.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/84955] [7/8 Regression] Incorrect OpenACC tile expansion

2018-03-23 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84955

--- Comment #4 from cesar at gcc dot gnu.org ---
It fails in C with this:

#pragma acc parallel loop tile(2,3)
  for (i = 1; i < 10; i++)
for (j = 1; j < 10; j++)
  for (;;)
;

It must be that empty loop that tripping up the oacc tile lowering code.

[Bug target/85056] [nvptx] wrong declaration of external arrays

2018-03-23 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

--- Comment #1 from cesar at gcc dot gnu.org ---
Created attachment 43744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43744=edit
WIP patch

It looks like nvptx_assmeble_decl_begin ignores the array type information.
This patch records whether it has detected an aggregate type on entry to that
function. Then it emits an empty '[]' if it has detected an aggregate type with
out a defined size.

[Bug target/85056] New: [nvptx] wrong declaration of external arrays

2018-03-23 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85056

Bug ID: 85056
   Summary: [nvptx] wrong declaration of external arrays
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

Created attachment 43743
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43743=edit
test case

The attached test case consists of two files, one containing a definition of an
array 'a', and another using it. To build the program, just run `nvptx-run -O2
main.c extern.c`. nvptx-run reports the following error:

error   : Size doesn't match for 'a' in 'input file 2 at offset 2882', first
specified in 'input file 1 at offset 2171'

There's something wrong with the way that 'a' is being declared for for main.
GCC emitting the declaration as

// BEGIN GLOBAL VAR DECL: a 
.extern .global .align 4 .u32 a; 

But that is really declaring variable 'a' as an integer of size four bytes.
Variable 'a' should be declared as:

// BEGIN GLOBAL VAR DECL: a 
.extern .global .align 4 .u32 a[]; 

Note the additional [] after a.

I was able to reproduce this problem using CUDA 9 / Nvidia driver 390.42 on an
sm_60 GPU using trunk and openacc-gcc-7-branch.

[Bug libgomp/84871] New: libgomp examples-4/declare_target-[12].f90 fail with nvptx Titan V offloading

2018-03-14 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84871

Bug ID: 84871
   Summary: libgomp examples-4/declare_target-[12].f90 fail with
nvptx Titan V offloading
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: libgomp
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Both libgomp.fortran/examples-4/declare_target-1.f90 and
libgomp.fortran/examples-4/declare_target-2.f90 fail when offloaded on Nvidia
Titan V (or Volta family) GPUs running Nvida driver 390.25. The failure appears
to be the result of a limited per-CUDA thread stack size of 1024b as collected
by cuCtxGetLimit (..., CU_LIMIT_STACK_SIZE).

Those tests only fail at -O1, -O2 and -Os. Furthermore, all of the tests pass
on older Nvidia GPUs, including Kepler (K80s) and Pascal (GeForce 1080).

One thing I noticed was that ptxas reports that it is spilling more registers
to the stack for the Volta GPUs than it is for Pascal GPUs. Here's the relevant
statistics for Pascal:

ptxas info: Function properties for __e_53_1_mod_MOD_fib
24 bytes stack frame, 24 bytes spill stores, 24 bytes spill loads

Here are the corresponding statistics for Volta:

ptxas info: Function properties for __e_53_1_mod_MOD_fib
40 bytes stack frame, 40 bytes spill stores, 40 bytes spill loads

Given that we can't control the PTX driver JIT, maybe we should either reduce
the recursion depth in declare_target-[12].f90 to 20 (actually fib (22) works,
but I don't a newer driver to break it again), or or just xfail those tests for
nvptx targets. 

The CUDA driver API provides cuCtxSetLimit function to adjust the stack limit,
but apparently, that only adjusts the upper bound limit.

[Bug target/84571] [og7, openacc, nvptx] 32-bit value passed in 64 bits to offloading function

2018-03-05 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84571

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #1 from cesar at gcc dot gnu.org ---
The is the legacy firstprivate_int optimization. Prior to the param state
optimization, GCC used to build a struct of pointers to all of the data
mappings used by an offloaded region. That struct would then be passed to the
offloaded function. To optimize the transfer of firstprivate integer values,
Jakub introduced an GOMP_MAP_FIRSTPRIVATE_INT data mapping, which effective
converts 32-bit ints to 64-bit ints. The advantage here is that those
firstprivate values do not require a separate data mapping, because the 64-bt
int is casted into a dummy pointer. There should be on-device code to reconvert
that 64-bit int into a 32-bit int. If not, there's a bug somewhere.

With regards to OpenACC code passing data mappings to offloaded functions
directly via function arguments, it's not clear if the approach I took is
optimal for all targets. So, maybe when it comes time to upstream that patch,
it could be rewritten as a separate device-specific pass which expands struct
containing all of the offloaded data mappings into individual function
arguments.

[Bug target/84570] [og7, openacc, nvptx] Unused offloaded function parameters

2018-03-05 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84570

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #1 from cesar at gcc dot gnu.org ---
First, variable 'i' is private, so it shouldn't require a param argument.

What we really need here is proper data flow analysis during gimplification.
That would solve a lot of performance issues, including privatizing
uninitialized, privatizing variables only live inside a parallel region, not
transferring unused variables, not copying out dead variables, etc. 

I like the idea of privatizing uninitialized variables, but if I'm not
mistaken, that would still require DF information. It looks like that
information doesn't become available until the gimple code goes into SSA.

As an alternative, I proposed postponing the outlining of omp/acc regions until
the SSA information is available. But then that approach would have its own set
of problems.

[Bug target/80547] [6/7/8 Regression] nvptx back end ICE with OpenACC "reduction(OP:x)", "x = [...]"

2018-01-22 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80547

--- Comment #5 from cesar at gcc dot gnu.org ---
I wasn't able to reproduce the nvptx ICE in og7. However, the host fallback
does segfault at runtime in og7.

[Bug target/83790] Update nvptx target to work with cuda 9

2018-01-19 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83790

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Jan 19 14:21:08 2018
New Revision: 256891

URL: https://gcc.gnu.org/viewcvs?rev=256891=gcc=rev
Log:
[nvptx] Add support for CUDA 9

PR target/83790

gcc/
* config/nvptx/nvptx.c (output_init_frag): Don't use generic address
spaces for function labels.

gcc/testsuite/
* gcc.target/nvptx/indirect_call.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/nvptx/indirect_call.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/nvptx/nvptx.c
trunk/gcc/testsuite/ChangeLog

[Bug target/83920] [nvptx] bad predicate reset

2018-01-18 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920

--- Comment #10 from cesar at gcc dot gnu.org ---
And here is the working code in -O2:

{
.reg.u32%x;
mov.u32 %x, %tid.x;
setp.ne.u32 %r71, %x, 0;
}
@%r71   bra $L13;
mov.u64 %r45, %ar0;
mov.u64 %r46, %ar1;
mov.u32 %r42, %ctaid.x;
shl.b32 %r48, %r42, 2;
add.u32 %r37, %r48, %r42;
mov.u32 %r31, 5;
setp.ne.u64 %r64, %r46, 1;
mov.u32 %r66, 0;
$L13:
$L3:
mov.pred%r74, %r64;
setp.eq.u32 %r64, 1, 0;
@%r71   bra $L12;
$L12:
mov.pred%r64, %r74;
selp.u32%r75, 1, 0, %r64;
shfl.idx.b32%r75, %r75, 0, 31;
setp.ne.u32 %r64, %r75, 0;
@%r64   bra.uni $L2;
$L6:

Notice how gcse's PRE pass hoisted the initialization of %r64 early in the
entry block.

I think we should go with my patch. If the register is live, it shouldn't
require your workaround.

[Bug target/83920] [nvptx] bad predicate reset

2018-01-18 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920

--- Comment #9 from cesar at gcc dot gnu.org ---
I figured out why my patch does work. Here's the assembly code for your C test
case at -O0:

{
.reg.u32%x;
mov.u32 %x, %tid.x;
setp.ne.u32 %r81, %x, 0;
}
@%r81   bra $L11;
mov.u64 %r58, %ar0;
st.u64  [%frame+32], %r58;
mov.u64 %r59, %ar1;
st.u64  [%frame+40], %r59;
ld.u64  %r60, [%frame+40];
cvt.u32.u64 %r26, %r60;
st.u32  [%frame], %r26;
ld.u64  %r61, [%frame+32];
st.u64  [%frame+8], %r61;
mov.u32 %r22, 0;
mov.u32 %r28, 1;
mov.u32 %r29, 1;
$L11:
$L9:
mov.pred%r82, %r62;
setp.eq.u32 %r62, 1, 0;
@%r81   bra $L12;
mov.u32 %r55, %nctaid.x;
mov.u32 %r56, %ctaid.x;
mov.u32 %r48, 9;
add.u32 %r49, %r55, %r48;
div.s32 %r50, %r49, %r55;
mul.lo.u32  %r23, %r56, %r50;
mov.u32 %r57, %nctaid.x;
mov.u32 %r51, 9;
add.u32 %r52, %r57, %r51;
div.s32 %r53, %r52, %r57;
add.u32 %r54, %r23, %r53;
min.s32 %r30, %r54, 10;
setp.ge.s32 %r62, %r23, %r30;
$L12:
mov.pred%r62, %r82;
selp.u32%r83, 1, 0, %r62;
shfl.idx.b32%r83, %r83, 0, 31;
setp.ne.u32 %r62, %r83, 0;
@%r62   bra.uni $L2;
$L4:
mov.pred%r84, %r64;
setp.eq.u32 %r64, 1, 0;
@%r81   bra $L13;

The predicate register in question here is %r62. Notice how the JIT workaround
clobbers %r62 much earlier than it's defined. My patch just copied the register
predicate register before it was clobbered. That's fine, but when it restores
the value of %r62 in L12, r62 gets an uninitialized value.

[Bug target/83920] [nvptx] bad predicate reset

2018-01-18 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920

--- Comment #8 from cesar at gcc dot gnu.org ---
I tweaked your proposed fix as follows:

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 55c7e3cbf90..24625cd303f 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -4104,8 +4104,11 @@ nvptx_single (unsigned mask, basic_block from,
basic_block to)
mov.u32 %x,%tid.x;
setp.ne.u32 %rnotvzero,%x,0;
 }
+  reg.pred %rcond2; // Scratch copy of the original rcond.

+  mov.pred %rcond2, %rcond;
 @%rnotvzero bra Lskip;
+  mov.pred %rcond, %rcond2
 setp.. %rcond,op1,op2;
 Lskip:
 selp.u32 %rcondu32,1,0,%rcond;
@@ -4126,8 +4129,11 @@ nvptx_single (unsigned mask, basic_block from,
basic_block to)
 There is nothing in the PTX spec to suggest that this is wrong, or
 to explain why the extra initialization is needed.  So, we
classify
 it as a JIT bug, and the extra initialization as workaround.  */
- emit_insn_before (gen_movbi (pvar, const0_rtx),
-   bb_first_real_insn (from));
+   rtx_insn *from_insn = bb_first_real_insn (from);
+   rtx ptmp = gen_reg_rtx (GET_MODE (pvar));
+   emit_insn_before (gen_rtx_SET (ptmp, pvar), from_insn);
+   emit_insn_before (gen_movbi (pvar, const0_rtx), from_insn);
+   emit_insn_before (gen_rtx_SET (pvar, ptmp), tail);
 #endif
  emit_insn_before (nvptx_gen_vcast (pvar), tail);
}

This generates the following assembly code for gemm.f90:

$L34:
$L11:
mov.pred%r413, %r314;
setp.eq.u32 %r314, 1, 0;
@%r402  bra $L33;
$L33:
mov.pred%r314, %r413;
selp.u32%r414, 1, 0, %r314;
shfl.idx.b32%r414, %r414, 0, 31;
setp.ne.u32 %r314, %r414, 0;
@!%r314 bra.uni $L22;
bra $L3;
$L12:

I'm not sure what's going on here, because this patch causes illegal memory
access errors in lsdalton. Any thoughts?

Maybe a more involved workaround would be to leave r314 alone, and use the
scratch %r413 register as the predicate. But, then wouldn't the prevent the PRE
code hoisting optimization which moved the computation for %r314 outside of the
loop in the first place?

Is this original PTX JIT bug still present in the current Nvidia drivers? You
mentioned that this problem first appeared in 381.22. I wonder if it has been
resolved in 387.

[Bug target/83920] [nvptx] bad predicate reset

2018-01-17 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920

--- Comment #1 from cesar at gcc dot gnu.org ---
Created attachment 43165
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43165=edit
assembly code

[Bug target/83920] New: [nvptx] bad predicate reset

2018-01-17 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920

Bug ID: 83920
   Summary: [nvptx] bad predicate reset
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---

Created attachment 43164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43164=edit
gemm test case

Here <https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00516.html> Tom posted a
patch to workaround a PTX JIT bug. However, workaround may clobber a live
predicate register. Consider the offloaded code for the attached gemm.f90
(built using trunk with -fopenacc -O3, but the underlying problem is present in
og7 and impacts da-1.c). 

The nvptx compiler generates:

$L35:
selp.u32%r348, 1, 0, %r191;
shfl.idx.b32%r348, %r348, 0, 31;
setp.ne.u32 %r191, %r348, 0;
@%r191  bra.uni $L2;
@%r341  bra $L34;
mov.u32 %r155, %r61;
shl.b64 %r158, %r43, 5;
cvt.s64.s32 %r192, %r155;
add.u64 %r161, %r192, 1;
add.u32 %r193, %r53, -1;
cvt.u64.u32 %r166, %r193;
add.u64 %r194, %r41, 2;
add.u64 %r195, %r194, %r166;
mad.lo.u64  %r156, %r43, %r161, %r195;
shl.b64 %r169, %r39, 5;
mad.lo.u64  %r167, %r161, %r39, %r37;
setp.eq.f32 %r266, %r49, 0f;
setp.le.s32 %r267, %r53, 0;
add.u32 %r270, %r55, -1;
mov.f32 %r271, 0f;
setp.eq.f32 %r272, %r49, 0f3f80;
$L34:
$L11:
setp.eq.u32 %r266, 1, 0;
@%r341  bra $L33;
$L33:
selp.u32%r347, 1, 0, %r266;
shfl.idx.b32%r347, %r347, 0, 31;
setp.ne.u32 %r266, %r347, 0;
@!%r266 bra.uni $L22;
bra $L3;
$L12:

Note how %r266 is defined in block $L35, but then it gets clobbered in block
$L33. 

This corresponds to the case where beta == 0 in the gemm.f90. I think there
might be other PTX JIT bugs lurking here, because the test program still works
as intended.

[Bug middle-end/78266] broken openacc loop partitioning on nvptx offloading targets

2017-08-07 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78266

--- Comment #8 from cesar at gcc dot gnu.org ---
Because num_gangs exceeds largest unsigned value that can be represented by the
induction variable.

[Bug middle-end/78266] broken openacc loop partitioning on nvptx offloading targets

2017-08-07 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78266

--- Comment #6 from cesar at gcc dot gnu.org ---
I'm not sure that solution is correct.  A better solution would be to report an
error/warning stating that num_workers exceeds the size of the induction
variable. Also, in the case that user doesn't specify num_gangs and the type of
the induction variable is less than integer_node_type, then hard-code num_gangs
to 255 or something small so that the runtime doesn't assign num_gangs that
generate bogus results.

[Bug gcov-profile/81442] error: verify_flow_info: REG_BR_PROB is set but cfg probability is not during RTL pass: outof_cfglayout

2017-07-17 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81442

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #4 from cesar at gcc dot gnu.org ---
I posted a patch that fixes this issue on July 13, 2017:

https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00750.html

It is pending review.

[Bug fortran/77765] ICE in gfc_match_oacc_routine, at fortran/openmp.c:1781

2017-06-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77765

--- Comment #3 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu Jun 29 19:07:10 2017
New Revision: 249810

URL: https://gcc.gnu.org/viewcvs?rev=249810=gcc=rev
Log:
Backport fix for PR fortran/77765

gcc/fortran/
* openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
comparing the routine name against it.

gcc/testsuite/
* gfortran.dg/goacc/pr77765.f90: New test.

Added:
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/pr77765.f90
Modified:
branches/gomp-4_0-branch/gcc/fortran/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/fortran/openmp.c
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp

[Bug fortran/77765] ICE in gfc_match_oacc_routine, at fortran/openmp.c:1781

2017-06-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77765

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu Jun 29 19:03:43 2017
New Revision: 249809

URL: https://gcc.gnu.org/viewcvs?rev=249809=gcc=rev
Log:
PR fortran/77765

gcc/fortran/
* openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
comparing the routine name against it.

gcc/testsuite/
* gfortran.dg/goacc/pr77765.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/goacc/pr77765.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/openmp.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/80029] [6/7 Regression] valgrind error in new_omp_context(omp_region_type) (gimplify.c:400)

2017-03-22 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80029

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from cesar at gcc dot gnu.org ---
Fixed in trunk.

[Bug c++/80029] [6/7 Regression] valgrind error in new_omp_context(omp_region_type) (gimplify.c:400)

2017-03-22 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80029

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Mar 22 13:52:10 2017
New Revision: 246381

URL: https://gcc.gnu.org/viewcvs?rev=246381=gcc=rev
Log:
PR c++/80029

gcc/
* gimplify.c (is_oacc_declared): New function.
(oacc_default_clause): Use it to set default flags for acc declared
variables inside parallel regions.
(gimplify_scan_omp_clauses): Strip firstprivate pointers for acc
declared variables.
(gimplify_oacc_declare): Gimplify the declare clauses.  Add the
declare attribute to any decl as necessary.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/declare-vla.c: New test.

Added:
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/libgomp/ChangeLog

[Bug c++/80029] [6/7 Regression] valgrind error in new_omp_context(omp_region_type) (gimplify.c:400)

2017-03-20 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80029

--- Comment #3 from cesar at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #2)
> That doesn't work, it is too early.
> With:
> --- gimplify.c.jj 2017-03-08 18:19:24.0 +0100
> +++ gimplify.c2017-03-20 07:22:05.587913531 +0100
> @@ -9261,6 +9261,8 @@ gimplify_oacc_declare (tree *expr_p, gim
>omp_add_variable (gimplify_omp_ctxp, decl, GOVD_SEEN);
>  }
>  
> +  gimplify_adjust_omp_clauses (pre_p, NULL, , OACC_DECLARE);
> +
>stmt = gimple_build_omp_target (NULL, GF_OMP_TARGET_KIND_OACC_DECLARE,
> clauses);
>  
> we don't ICE on it, but still no idea what is the right thing to do.
> From what I understand, #pragma acc declare is active for all code from the
> directive till end of function (unless the variables mentioned in its
> clauses go out of scope earlier), so in theory perhaps the right thing is to
> move the gimplify omp context structure up in the gimplify context tree so
> that they are just children of the function (what happens if you put #pragma
> acc declare inside
> the body of some other acc region?).

You are correctly describing the behavior of declare in OpenACC. Declared
variables live throughout the scope specified by the user. However, I believe
the scope must be global or function, i.e. I don't think you can declare
variables inside nested blocks in C/C++.

> Though on the other side, e.g. for #pragma omp target enter data we adjust
> the omp clauses right away, but that doesn't really affect the handling of
> variables later on.  So, the important question is do you need the variables
> mentioned in acc declare clauses to be in the hash tables as GOMP_MAP after
> gimplify_oacc_declare returns or not?  If not, then the above patch might
> DTRT, otherwise we need to figure out something different.

I don't think this memory leak is present in gomp-4_0-branch. The patch that
resolves this issue was posted back in September 2016 here
<https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01630.html>. I'll rebuild trunk
with that patch to see if it resolves the memory leak there.

[Bug ipa/78027] [6 Regression] ICE in new_oacc_loop_routine, at omp-low.c:19000

2017-02-05 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78027

--- Comment #7 from cesar at gcc dot gnu.org ---
Last I heard in <https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01050.html>
Jakub was going to look for a better solution. My patch is still in trunk, but
if necessary I could always revert it.

[Bug ipa/78027] [6/7 Regression] ICE in new_oacc_loop_routine, at omp-low.c:19000

2016-12-09 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78027

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Dec  9 14:45:54 2016
New Revision: 243488

URL: https://gcc.gnu.org/viewcvs?rev=243488=gcc=rev
Log:
PR ipa/78027

gcc/
* ipa-icf.c (sem_function::parse): Don't process functions with
oacc decl attributes, as they may be OpenACC routines.

gcc/testsuite/
* c-c++-common/goacc/acc-icf.c: New test.
* gfortran.dg/goacc/pr78027.f90: New test.

Added:
trunk/gcc/testsuite/c-c++-common/goacc/acc-icf.c
trunk/gcc/testsuite/gfortran.dg/goacc/pr78027.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-icf.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/78266] New: broken openacc loop partitioning on nvptx offloading targets

2016-11-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78266

Bug ID: 78266
   Summary: broken openacc loop partitioning on nvptx offloading
targets
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-linux-gnu, nvptx-none

Created attachment 3
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3=edit
vprop.c

The attached test case demonstrates a situation where an acc 'gang worker'
partitioned loop encloses an acc vector partitioned loop fails to generate
correct code. I'm not sure if there is a problem in the nvptx backend
worker-state propagator, or if oaccdevlow is generating bad code.

This test case works fine if the outer loop is either gang or worker
partitioned, but not both.

[Bug fortran/72715] ICE in gfc_trans_omp_do, at fortran/trans-openmp.c:3164

2016-08-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72715

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Mon Aug 29 21:16:04 2016
New Revision: 239845

URL: https://gcc.gnu.org/viewcvs?rev=239845=gcc=rev
Log:
PR fortran/72715

gcc/fortran/
* openmp.c (resolve_oacc_nested_loops): Error on do concurrent loops.

gcc/testsuite/
* gfortran.dg/goacc/loop-3-2.f95: Error on do concurrent loops.
* gfortran.dg/goacc/loop-3.f95: Likewise.
* gfortran.dg/goacc/pr72715.f90: New test.



Added:
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/pr72715.f90
Modified:
branches/gomp-4_0-branch/gcc/fortran/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/fortran/openmp.c
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/loop-3-2.f95
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/loop-3.f95

[Bug libfortran/74755] libgfortran: build breaks if localtime_r prototype is present, but definition is not

2016-08-24 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=74755

--- Comment #2 from cesar at gcc dot gnu.org ---
The target is nvptx-none, specifically when it is built as an offloaded target
for OpenACC. Thomas thinks the problem is in newlib rather than gcc though.

[Bug middle-end/70828] broken array-type subarrays inside acc data in openacc

2016-08-17 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70828

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu Aug 18 01:12:15 2016
New Revision: 239554

URL: https://gcc.gnu.org/viewcvs?rev=239554=gcc=rev
Log:
PR middle-end/70828

gcc/
* gimplify.c (struct gimplify_omp_ctx): Add tree clauses member.
(new_omp_context): Initialize clauses to NULL_TREE.
(gimplify_scan_omp_clauses): Set clauses in the gimplify_omp_ctx.
(omp_clause_matching_array_ref): New function.
(gomp_needs_data_present): New function.
(gimplify_adjust_omp_clauses_1): Use preset or pointer omp clause map
kinds when creating implicit data clauses for OpenACC offloaded
variables defined used an acc data region as necessary. 

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr70828.c: New test.
* testsuite/libgomp.oacc-fortran/pr70828.f90: New test.


Added:
   
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70828.c
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-fortran/pr70828.f90
Modified:
branches/gomp-4_0-branch/gcc/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/gimplify.c
branches/gomp-4_0-branch/libgomp/ChangeLog.gomp

[Bug fortran/74600] New: [openacc] duplicate data map error

2016-08-11 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=74600

Bug ID: 74600
   Summary: [openacc] duplicate data map error
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: cesar at gcc dot gnu.org, tschwinge at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-linux-gnu, nvptx-none

Created attachment 39268
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39268=edit
duplicate-map.f90

The attached test case yields the following 'already mapped' error at runtime
when ACC_DEVICE_TYPE=nvidia:

libgomp: Trying to map into device [0x7ffe515d5ee0..0x7ffe515d5ee4) object when
[0x7ffe515d5ee0..0x7ffe515d5ef0) is already mapped

Looking at the omplower tree dump for program test I see 

 FRAME.1.FRAME_BASE.PARENT = 0B;
  try
{
  D.3446 = 2.0e+0;
  FRAME.1.a = D.3446;
  {
.omp_data_arr.4.FRAME.1 = 
.omp_data_arr.4.a = 
#pragma omp target oacc_parallel map(tofrom:FRAME.1) map(force_tofrom:a
[len: 4]) [child fn: MAIN__._omp_fn.0 (.omp_data_arr.4, .omp_data_sizes.5,
.omp_data_kinds.6)]
  {

After inspecting the hostaddrs passed to GOACC_parallel_keyed, both variable
'a' and FRAME.1 share the same address, hence the duplicate data mapping error.

This issue is present on at least gomp-4_0-branch with nvptx offloading. I
wasn't able to try trunk because it stopped building on nvptx as of Aug 11, so
I'll retest trunk once that problem has been resolved.

[Bug fortran/72741] Fortran OpenACC routine directive doesn't properly handle clauses specifying the level of parallelism

2016-08-10 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72741

--- Comment #6 from cesar at gcc dot gnu.org ---
(In reply to Thomas Schwinge from comment #5)
> (In reply to cesar from comment #4)

> Are you saying that's not how the Fortran front end operates, and the
> "SUBROUTINE r_w" and the later "PROGRAM main" do see completly detached
> "decl spaces"?  Then indeed, we can't verify this in the Fortran front end,
> but...

Yes, the address spaces are completely detached in separate, external function.
Internal functions, i.e. those that are places after "contains:" share the same
scope as the main program/module block. 

Keep in mind that fortran has a lot of intrinsic procedures, so those find
function/subroutine functions mostly resolve those intrinsic procedures or
procedures explicitly declared by the user.

> > especially if lto is not enabled. If lto
> > is enabled, we could add some more checking in pass oacc_device_lower.
> 
> ..., as discussed before, something like that is the final goal that I'm
> working on, and for that...
> 
> > But I
> > don't think there's anything else to do in the fortran front end.
> 
> ..., please implement the changes I asked you to implement in Comment 3,
> #c3, or elaborate why that doesn't make sense.

That's a good idea in principle, but there are a couple of reasons why I'm
hesitant to pursue it.

a) The fortran pretty printer doesn't know about generic tree notes.
Consequently, I don't think build_oacc_routine_dims would be able to report any
errors unless we add support for tree notes in that pretty printer.

b) The fortran FE handle errors slightly differently from the c FE. Instead of
catching the error early and aborting immediately, you're method will defer the
error handling to after the FE has parsed everything. I'm not sure if this is a
problem or not.

c) That oacc_function information needs to be captured for fortran module .mod
files, and those .mod files don't require tree node attributes. Postponing that
attribute requires separate functions to manipulate the routine clauses.

d) gfc_oacc_routine_dims is already creating an oacc_function attribute for
routines. This attribute is a single enum instead of the individual clauses. I
like that because its more self contained.

[Bug fortran/72741] Fortran OpenACC routine directive doesn't properly handle clauses specifying the level of parallelism

2016-08-09 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72741

--- Comment #4 from cesar at gcc dot gnu.org ---
I could be mistaken, but I don't think there's anything we can do about that
test case because fortran doesn't have file scope. Specifically, in your
example,

SUBROUTINE r_w
  IMPLICIT NONE
  INTEGER :: i
  !$ACC ROUTINE WORKER

  !$ACC LOOP
  DO i = 1, 12345
  END DO
END SUBROUTINE r_w

PROGRAM main
  IMPLICIT NONE
  EXTERNAL :: r_w
  !$ACC ROUTINE (r_w) GANG

  !$ACC PARALLEL
  CALL r_w
  !$ACC END PARALLEL
END PROGRAM main

from program main's perspective, r_w should be an acc routine with a gang
attribute, but that's only because the end user included an explicit 'external'
function declaration. I'm not sure how to catch mismatched function
declarations in fortran, especially if lto is not enabled. If lto is enabled,
we could add some more checking in pass oacc_device_lower. But I don't think
there's anything else to do in the fortran front end.

It should be noted that if the user wants to avoid these types of problems, acc
routines should be placed inside modules. That way, each procedure sees the
same acc routine attributes.

[Bug fortran/72741] Fortran OpenACC routine directive doesn't properly handle clauses specifying the level of parallelism

2016-07-28 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72741

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Jul 29 04:20:00 2016
New Revision: 238847

URL: https://gcc.gnu.org/viewcvs?rev=238847=gcc=rev
Log:
PR fortran/72741
gcc/fortran/
* openmp.c (gfc_oacc_routine_dims): Move gfc_error to
gfc_match_oacc_routine.  Return OACC_FUNCTION_NONE on error.
(gfc_match_oacc_routine): Call gfc_oacc_routine_dims for all
routines directives.  Propagate error as appropriate.

gcc/testsuite/
* gfortran.dg/goacc/pr72741.f90: New test.


Added:
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/pr72741.f90
Modified:
branches/gomp-4_0-branch/gcc/fortran/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/fortran/openmp.c
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp

[Bug c/70688] bogus OpenACC data clause errors involving reductions

2016-06-01 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70688

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from cesar at gcc dot gnu.org ---
Fixed in r237011.

[Bug c/70688] bogus OpenACC data clause errors involving reductions

2016-06-01 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70688

--- Comment #3 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Jun  1 20:40:10 2016
New Revision: 237012

URL: https://gcc.gnu.org/viewcvs?rev=237012=gcc=rev
Log:
PR c/70688
* pr70688.c: New file.


Added:
   
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
Modified:
branches/gomp-4_0-branch/libgomp/ChangeLog.gomp

[Bug c/70688] bogus OpenACC data clause errors involving reductions

2016-06-01 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70688

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Jun  1 20:37:44 2016
New Revision: 237011

URL: https://gcc.gnu.org/viewcvs?rev=237011=gcc=rev
Log:
PR c/70688
* pr70688.c: New file.


Added:
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/pr70688.c
Modified:
trunk/libgomp/ChangeLog

[Bug c/70688] bogus OpenACC data clause errors involving reductions

2016-06-01 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70688

--- Comment #1 from cesar at gcc dot gnu.org ---
Created attachment 38621
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38621=edit
new test case

This issue has been resolved in trunk r236678. I forgot to include a PR tag in
the ChangeLog entry. 

To verify the fix, I modified the original test case to make it executable in
the libgomp test suite. Furthermore, I changed parallel regions to parallel
loop regions so that the reduction yields sane results with multiple gangs.
I'll commit this test case to trunk with the proper PR tag in the ChangeLog
entry before I close this issue.

[Bug middle-end/70626] bogus results in 'acc parallel loop' reductions

2016-05-09 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

--- Comment #6 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Mon May  9 20:42:47 2016
New Revision: 236049

URL: https://gcc.gnu.org/viewcvs?rev=236049=gcc=rev
Log:
Backport trunk r235651:
2016-04-29  Cesar Philippidis  <ce...@codesourcery.com>

gcc/c-family/
PR middle-end/70626
* c-common.h (c_oacc_split_loop_clauses): Add boolean argument.
* c-omp.c (c_oacc_split_loop_clauses): Use it to duplicate
reduction clauses in acc parallel loops.

gcc/c/
PR middle-end/70626
* c-parser.c (c_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(c_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/cp/
PR middle-end/70626
* parser.c (cp_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(cp_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/fortran/
PR middle-end/70626
* trans-openmp.c (gfc_trans_oacc_combined_directive): Duplicate
the reduction clause in both parallel and loop directives.

gcc/testsuite/
PR middle-end/70626
* c-c++-common/goacc/combined-reduction.c: New test.
* gfortran.dg/goacc/reduction-2.f95: Add check for kernels reductions.

libgomp/
PR middle-end/70626
* testsuite/libgomp.oacc-c++/template-reduction.C: Adjust test.
* testsuite/libgomp.oacc-c-c++-common/combined-reduction.c: New test.
* testsuite/libgomp.oacc-fortran/combined-reduction.f90: New test.


Added:
   
branches/gomp-4_0-branch/gcc/testsuite/c-c++-common/goacc/combined-reduction.c
branches/gomp-4_0-branch/gcc/testsuite/c-c++-common/goacc/pr70688.c
   
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-reduction.c
   
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-fortran/combined-reduction.f90
Modified:
branches/gomp-4_0-branch/gcc/c-family/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/c-family/c-common.h
branches/gomp-4_0-branch/gcc/c-family/c-omp.c
branches/gomp-4_0-branch/gcc/c/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/c/c-parser.c
branches/gomp-4_0-branch/gcc/cp/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/cp/parser.c
branches/gomp-4_0-branch/gcc/cp/semantics.c
branches/gomp-4_0-branch/gcc/fortran/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/fortran/gfortran.h
branches/gomp-4_0-branch/gcc/fortran/match.c
branches/gomp-4_0-branch/gcc/fortran/trans-openmp.c
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp
   
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/combined-directives.f90
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/reduction-2.f95
   
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C

[Bug c++/69363] ICE when doing a pragma simd reduction with max

2016-05-09 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69363

--- Comment #8 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Mon May  9 20:23:31 2016
New Revision: 236047

URL: https://gcc.gnu.org/viewcvs?rev=236047=gcc=rev
Log:
Backport trunk r235290:
2016-04-20  Ilya Verbin  <ilya.ver...@intel.com>

gcc/c-family/
PR c++/69363
* c-cilkplus.c (c_finish_cilk_clauses): Remove function.
* c-common.h (c_finish_cilk_clauses): Remove declaration.

gcc/c/
PR c++/69363
* c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses
instead of c_finish_cilk_clauses.
* c-tree.h (c_finish_omp_clauses): Add new default argument.
* c-typeck.c (c_finish_omp_clauses): Add new argument.  Allow
floating-point variables in the linear clause for Cilk Plus.

gcc/cp/
PR c++/69363
* cp-tree.h (finish_omp_clauses): Add new default argument.
* parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
instead of c_finish_cilk_clauses.
* semantics.c (finish_omp_clauses): Add new argument.  Allow
floating-point variables in the linear clause for Cilk Plus.

gcc/testsuite/
PR c++/69363
* c-c++-common/cilk-plus/PS/clauses3.c: Adjust dg-error string.
* c-c++-common/cilk-plus/PS/clauses4.c: New test.
* c-c++-common/cilk-plus/PS/pr69363.c: New test.


Added:
branches/gomp-4_0-branch/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c
branches/gomp-4_0-branch/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c
Modified:
branches/gomp-4_0-branch/gcc/c-family/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/c-family/c-cilkplus.c
branches/gomp-4_0-branch/gcc/c-family/c-common.h
branches/gomp-4_0-branch/gcc/c/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/c/c-parser.c
branches/gomp-4_0-branch/gcc/c/c-tree.h
branches/gomp-4_0-branch/gcc/c/c-typeck.c
branches/gomp-4_0-branch/gcc/cp/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/cp/cp-tree.h
branches/gomp-4_0-branch/gcc/cp/parser.c
branches/gomp-4_0-branch/gcc/cp/semantics.c
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c

[Bug fortran/70895] OpenACC: loop reduction does not work. Output is zero.

2016-05-02 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70895

--- Comment #4 from cesar at gcc dot gnu.org ---
(In reply to Thomas Schwinge from comment #3)
> (In reply to cesar from comment #2)

> > Consequently, you need to
> > explicitly use num_gangs, num_workers and vector_length to determine the
> > amount of parallelism and gang, worker and vector to partition the acc loops
> > accordingly.
> 
> GCC 6.1 by default will configure nvptx offloading for 32 gangs, 32 workers,
> and a vector length of 32 (so, you don't need to specify "num_gangs()
> num_workers() vector_length()" clauses).  What it will not do (and what was
> the point of my earlier note in #c1), is assign more than one of OpenACC's
> parallelism levels (gang, worker, vector) to a one-level loop constructs,
> which is why you'll want to specify "gang worker vector" clauses for the
> loop construct.

Thomas is correct. I've been focusing too much on the front ends and not the
loop partitioning infrastructure. Sorry for the noise.

[Bug fortran/70895] OpenACC: loop reduction does not work. Output is zero.

2016-05-02 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70895

--- Comment #2 from cesar at gcc dot gnu.org ---
Thomas is correct. Note that when gcc-6.2 is released you should be able to
replace

   !$acc parallel vector_length(vl)
   !$acc loop reduction(+:pi) private(t) 

with

   !$acc parallel loop reduction(+:pi) vector_length(vl)

and that will automatically add a copy clause for 'pi'. See PR70626 for more
details.

Furthermore, as Thomas mentioned, gcc-6 does not automatically assign
parallelism to loops inside parallel regions. Consequently, you need to
explicitly use num_gangs, num_workers and vector_length to determine the amount
of parallelism and gang, worker and vector to partition the acc loops
accordingly. Also note that only nvptx targets are accelerated in gcc-6; the
host code runs in a single thread.

[Bug middle-end/70626] bogus results in 'acc parallel loop' reductions

2016-04-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from cesar at gcc dot gnu.org ---
Fixed in trunk and and gcc-6-branch.

[Bug middle-end/70626] bogus results in 'acc parallel loop' reductions

2016-04-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

--- Comment #4 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr 29 17:42:04 2016
New Revision: 235651

URL: https://gcc.gnu.org/viewcvs?rev=235651=gcc=rev
Log:
gcc/c-family/
PR middle-end/70626
* c-common.h (c_oacc_split_loop_clauses): Add boolean argument.
* c-omp.c (c_oacc_split_loop_clauses): Use it to duplicate
reduction clauses in acc parallel loops.

gcc/c/
PR middle-end/70626
* c-parser.c (c_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(c_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/cp/
PR middle-end/70626
* parser.c (cp_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(cp_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/fortran/
PR middle-end/70626
* trans-openmp.c (gfc_trans_oacc_combined_directive): Duplicate
the reduction clause in both parallel and loop directives.

gcc/testsuite/
PR middle-end/70626
* c-c++-common/goacc/combined-reduction.c: New test.
* gfortran.dg/goacc/reduction-2.f95: Add check for kernels reductions.

libgomp/
PR middle-end/70626
* testsuite/libgomp.oacc-c++/template-reduction.C: Adjust test.
* testsuite/libgomp.oacc-c-c++-common/combined-reduction.c: New test.
* testsuite/libgomp.oacc-fortran/combined-reduction.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/combined-reduction.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-reduction.c
trunk/libgomp/testsuite/libgomp.oacc-fortran/combined-reduction.f90
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.h
trunk/gcc/c-family/c-omp.c
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-parser.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-openmp.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-2.f95
trunk/libgomp/ChangeLog
trunk/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C

[Bug middle-end/70626] bogus results in 'acc parallel loop' reductions

2016-04-29 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

--- Comment #3 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr 29 17:37:55 2016
New Revision: 235650

URL: https://gcc.gnu.org/viewcvs?rev=235650=gcc=rev
Log:
gcc/c-family/
PR middle-end/70626
* c-common.h (c_oacc_split_loop_clauses): Add boolean argument.
* c-omp.c (c_oacc_split_loop_clauses): Use it to duplicate
reduction clauses in acc parallel loops.

gcc/c/
PR middle-end/70626
* c-parser.c (c_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(c_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/cp/
PR middle-end/70626
* parser.c (cp_parser_oacc_loop): Don't augment mask with
OACC_LOOP_CLAUSE_MASK.
(cp_parser_oacc_kernels_parallel): Update call to
c_oacc_split_loop_clauses.

gcc/fortran/
PR middle-end/70626
* trans-openmp.c (gfc_trans_oacc_combined_directive): Duplicate
the reduction clause in both parallel and loop directives.

gcc/testsuite/
PR middle-end/70626
* c-c++-common/goacc/combined-reduction.c: New test.
* gfortran.dg/goacc/reduction-2.f95: Add check for kernels reductions.

libgomp/
PR middle-end/70626
* testsuite/libgomp.oacc-c++/template-reduction.C: Adjust test.
* testsuite/libgomp.oacc-c-c++-common/combined-reduction.c: New test.
* testsuite/libgomp.oacc-fortran/combined-reduction.f90: New test.


Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/goacc/combined-reduction.c
   
branches/gcc-6-branch/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-reduction.c
   
branches/gcc-6-branch/libgomp/testsuite/libgomp.oacc-fortran/combined-reduction.f90
Modified:
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-common.h
branches/gcc-6-branch/gcc/c-family/c-omp.c
branches/gcc-6-branch/gcc/c/ChangeLog
branches/gcc-6-branch/gcc/c/c-parser.c
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/parser.c
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/trans-openmp.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/goacc/reduction-2.f95
branches/gcc-6-branch/libgomp/ChangeLog
   
branches/gcc-6-branch/libgomp/testsuite/libgomp.oacc-c++/template-reduction.C

[Bug middle-end/70828] New: broken array-type subarrays inside acc data in openacc

2016-04-27 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70828

Bug ID: 70828
   Summary: broken array-type subarrays inside acc data in openacc
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: cesar at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38351
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38351=edit
broken subarray

Given an array-typed subarray with a non-zero base element on an acc data
construct, the gimplifier will implicitly add a pcopy clause for any parallel
and kernels construct which uses that array. The pcopy is correct, but this
pcopy expects the entire array to be present on the accelerator. This
ultimately results in a runtime failure when the base of the subarray is not
element zero.

This problem can be reproduced with the attached test case in trunk and gcc-6.

[Bug c/70688] New: bogus OpenACC data clause errors involving reductions

2016-04-15 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70688

Bug ID: 70688
   Summary: bogus OpenACC data clause errors involving reductions
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: c
  Assignee: cesar at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38285
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38285=edit
test case

Here is the output of the attached test case when it is build with -fopenacc:

tr1.c: In function ‘sum’:
tr1.c:12:9: error: ‘s’ appears both in data and map clauses
 #pragma acc parallel num_gangs (10) copy (s) reduction (+:s)
 ^~~

There are two problems with this. 1) the c FE should not be reporting a data
map clause error on a reduction variable. 2) That error only gets detected some
of the time, depending on the ordering of the clauses (e.g. a data clause
involving variable 'v' appears before a reduction clause involving 'v' in the
clause list). A third problem would be that this error message is not specific
to OpenACC.

The c++ FE also has a similar problem.

[Bug middle-end/70643] broken openacc reduction inside a fortran module

2016-04-14 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70643

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from cesar at gcc dot gnu.org ---
Fixed in r234973.

[Bug middle-end/70643] broken openacc reduction inside a fortran module

2016-04-14 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70643

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Thu Apr 14 13:44:17 2016
New Revision: 234973

URL: https://gcc.gnu.org/viewcvs?rev=234973=gcc=rev
Log:
PR middle-end/70643

gcc/
* omp-low.c (lower_oacc_reductions): Check for TREE_CONSTANT
when building a mem ref for the incoming reduction variable.

libgomp/
* testsuite/libgomp.oacc-fortran/pr70643.f90: New test.


Added:
trunk/libgomp/testsuite/libgomp.oacc-fortran/pr70643.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/omp-low.c
trunk/libgomp/ChangeLog

[Bug testsuite/68242] FAIL: libgomp.oacc-c-c++-common/reduction-2.c, and other OpenACC reduction test case "oddities"

2016-04-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68242

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from cesar at gcc dot gnu.org ---
Fixed in r234957.

[Bug testsuite/68242] FAIL: libgomp.oacc-c-c++-common/reduction-2.c, and other OpenACC reduction test case "oddities"

2016-04-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68242

--- Comment #7 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Apr 13 18:54:41 2016
New Revision: 234957

URL: https://gcc.gnu.org/viewcvs?rev=234957=gcc=rev
Log:
libgomp/
PR testsuite/68242
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Adjust test.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.


Modified:
trunk/libgomp/ChangeLog
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c

[Bug middle-end/70643] New: broken openacc reduction inside a fortran module

2016-04-12 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70643

Bug ID: 70643
   Summary: broken openacc reduction inside a fortran module
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: cesar at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38248=edit
broken test case

The attached test case causes an ICE in omp_low.c:lower_oacc_reductions because
that function is only guarding the incoming reduction variable against
INTEGER_CST when it comes time to build a mem_ref to it. Instead that function
should be checking if incoming is a TREE_CONSTANT.

Thomas reported this problem for gomp-4_0-branch here
<https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00491.html>, and as he stated
this is also present in trunk. I'm testing a patch for it.

[Bug tree-optimization/70357] [openacc][gomp4] ICE on reduction (+:sum) private (sum)

2016-04-11 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70357

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from cesar at gcc dot gnu.org ---
This issue has been resolved in r234889. Note that private reductions are now
reported as errors.

[Bug tree-optimization/70357] [openacc][gomp4] ICE on reduction (+:sum) private (sum)

2016-04-11 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70357

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Mon Apr 11 23:21:28 2016
New Revision: 234889

URL: https://gcc.gnu.org/viewcvs?rev=234889=gcc=rev
Log:
gcc/
PR tree-optimization/70357
* gimplify.c (gimplify_scan_omp_clauses): Remove stale acc reduction
code.
(gimplify_adjust_omp_clauses): Add or adjust data clauses for acc
parallel reductions as necessary.  Error on those that are private.
(localize_reductions_r): Delete.
(localize_reductions): Delete.
(gimplify_omp_for): Don't call localize_reductions.
(gimplify_omp_workshare): Likewise.
* omp-low.c (build_outer_var_ref): Remove stale reduction-specific
corner cases.
(fixup_remapped_decl): Likewise.
(scan_sharing_clauses):  Don't install variables which are used in
acc parallel reductions.
(check_omp_nesting_restrictions): Remove stale reduction-specific
corner cases.
(scan_omp_1_stmt): Clean up whitespace.
(lower_rec_input_clauses): Remove stale reduction-specific corner
cases.
(lower_oacc_reductions): Update it to handle parallel, reference and
nested reductions.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree-core.h (enum omp_clause_code): Remove stale comments about
the fifth reduction clause operand.
* tree.c (omp_clause_num_ops): Set the number of reduction clause
operands to 5.
(walk_tree_1): Update error checking for the reduction clause.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.


Modified:
branches/gomp-4_0-branch/gcc/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/gimplify.c
branches/gomp-4_0-branch/gcc/omp-low.c
branches/gomp-4_0-branch/gcc/tree-core.h
branches/gomp-4_0-branch/gcc/tree.c
branches/gomp-4_0-branch/gcc/tree.h

[Bug middle-end/70626] bogus results in 'acc parallel loop' reductions

2016-04-11 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

--- Comment #2 from cesar at gcc dot gnu.org ---
Created attachment 38238
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38238=edit
counter example

I looked at the standard again, and it says that the reduction clause should be
associated with the acc loop. That does make sense because if it were
duplicated, then as my counter example shows, the final reduction value would
be num_gangs times larger than it would be if there were only one reduction
clause.

I'll see what the acc technical committee says about this.

[Bug middle-end/70626] New: bogus results in 'acc parallel loop' reductions

2016-04-11 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70626

Bug ID: 70626
   Summary: bogus results in 'acc parallel loop' reductions
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: openacc
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: cesar at gcc dot gnu.org
  Reporter: cesar at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
  Target Milestone: ---

Created attachment 38233
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38233=edit
test case

Currently, given a combined acc parallel loop of the form

  #pragma acc parallel loop reduction(+:var)

all of the front ends will split that loop as

  #pragma acc parallel
  #pragma acc loop reduction(+:var)

This is bad because the gimplifier will not assign an implicit present_or_copy
clause for the reduction variable 'var', instead 'var' gets transferred via
firstprivate. One solution here is to teach the front ends to attach the
reduction clause to both directives, instead of just the split acc loop.

[Bug middle-end/70533] reductions on reference-typed variables are broken in OpenACC

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70533

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug lto/70289] [openacc] ICE in input_varpool_node

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70289

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug middle-end/70534] openacc parallel reductions aren't neutered

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70534

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug tree-optimization/70373] [openacc] ICE with reduction clause in set_parm_rtl, at cfgexpand.c

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70373

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug middle-end/70535] broken nested reductions in openacc parallel regions

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70535

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug ipa/70348] [6 Regression][openacc] ICE in visit_ref_for_mod_analysis, at ipa-prop.c

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from cesar at gcc dot gnu.org ---
Fixed in r234840.

[Bug middle-end/70535] broken nested reductions in openacc parallel regions

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70535

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug lto/70289] [openacc] ICE in input_varpool_node

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70289

--- Comment #5 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug ipa/70348] [6 Regression][openacc] ICE in visit_ref_for_mod_analysis, at ipa-prop.c

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

--- Comment #10 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug middle-end/70534] openacc parallel reductions aren't neutered

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70534

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug middle-end/70533] reductions on reference-typed variables are broken in OpenACC

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70533

--- Comment #1 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug tree-optimization/70373] [openacc] ICE with reduction clause in set_parm_rtl, at cfgexpand.c

2016-04-08 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70373

--- Comment #2 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Fri Apr  8 21:09:47 2016
New Revision: 234840

URL: https://gcc.gnu.org/viewcvs?rev=234840=gcc=rev
Log:
gcc/
PR lto/70289
PR ipa/70348
PR tree-optimization/70373
PR middle-end/70533
PR middle-end/70534
PR middle-end/70535
* gimplify.c (gimplify_adjust_omp_clauses): Add or adjust data
clauses for acc parallel reductions as necessary.  Error on those
that are private.
* omp-low.c (scan_sharing_clauses): Don't install variables which
are used in acc parallel reductions.
(lower_rec_input_clauses): Remove dead code.
(lower_oacc_reductions): Add support for reference reductions.
(lower_reduction_clauses): Remove dead code.
(lower_omp_target): Don't remap variables appearing in acc parallel
reductions.
* tree.h (OMP_CLAUSE_MAP_IN_REDUCTION): New macro.

gcc/testsuite/
* c-c++-common/goacc/reduction-5.c: New test.
* c-c++-common/goacc/reduction-promotions.c: New test.
* gfortran.dg/goacc/reduction-3.f95: New test.
* gfortran.dg/goacc/reduction-promotions.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-vector-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-worker-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/loop-reduction-wv-p-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-1.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-2.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c: New
test.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70289.c: New test.
* testsuite/libgomp.oacc-c-c++-common/pr70373.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Add test
coverage.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-6.c: New test.
* testsuite/libgomp.oacc-c-c++-common/reduction.h: New test.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: New test.
* testsuite/libgomp.oacc-fortran/pr70289.f90: New test.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Add test coverage.
* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-7.f90: New test.


Added:
trunk/gcc/testsuite/c-c++-common/goacc/reduction-5.c
trunk/gcc/testsuite/c-c++-common/goacc/reduction-promotions.c
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-3.f95
trunk/gcc/testsuite/gfortran.dg/goacc/reduction-promotions.f90
   
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gang-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gw-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c
trunk

[Bug ipa/70348] [6 Regression][openacc] ICE in visit_ref_for_mod_analysis, at ipa-prop.c

2016-04-06 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

--- Comment #9 from cesar at gcc dot gnu.org ---
The patch I posted for PR70289 a couple of days ago also resolves this issue:
https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00202.html

  1   2   >