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

[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

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

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

Thomas Schwinge  changed:

   What|Removed |Added

   Assignee|tschwinge at gcc dot gnu.org   |cesar at gcc dot gnu.org

--- Comment #8 from Thomas Schwinge  ---
Cesar is now looking into resolving the OpenACC reduction issues.

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

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

Thomas Schwinge  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |tschwinge at gcc dot 
gnu.org

--- Comment #7 from Thomas Schwinge  ---
(In reply to Nathan Sidwell from comment #5)
> the intended current implementation is to treat 'sum' as firstprivate.

Not actively looking into that one at the moment, but:

> however, putting in an explicit firstprivate causes another different ICE
> (in  lower_oacc_reductions) -- regardless of whether 'sum' is a parameter,
> or a local (initialized) variable.  Clearly at least two other bugs lurk.

I highly suspect (will test) that ICE to be fixed by patch that I'm currently
preparing for trunk (already fixed on gomp-4_0-branch).

(In reply to Jakub Jelinek from comment #6)
> So, given this is a P1, is anyone working on it?

So, assigning to me for the moment; will then re-evaluate the status after the
ICE's fixed.

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

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

--- Comment #6 from Jakub Jelinek  ---
So, given this is a P1, is anyone working on it?

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

2016-03-23 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

--- Comment #5 from Nathan Sidwell  ---
the intended current implementation is to treat 'sum' as firstprivate. 
however, putting in an explicit firstprivate causes another different ICE (in 
lower_oacc_reductions) -- regardless of whether 'sum' is a parameter, or a
local (initialized) variable.  Clearly at least two other bugs lurk.

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

2016-03-23 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

Thomas Schwinge  changed:

   What|Removed |Added

 CC||nathan at gcc dot gnu.org

--- Comment #4 from Thomas Schwinge  ---
Martin, thanks for the initial analysis.

Nathan CCed for your information; here is a reduced test case (which hopefully
still exhibits the original problem):

void foo (int sum)
{
#pragma acc parallel reduction(+:sum)
  ;
}

The ICE goes away when adding a data clause, such as copy(sum).

When changing sum from a formal parameter to an (initialized) local variable,
without adding a data clause, there is no ICE, but a "warning: 'sum' is used
uninitialized in this function [-Wuninitialized]".  (This probably correct
given the current implementation, which requires you to specify a data clause
in addition to a reduction clause.)

We're currently clarifying with the OpenACC technical committee whether a
reduction clause actually implies a data clause.

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

2016-03-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #3 from Richard Biener  ---
Technically P1 but I guess we'll happily ignore openacc regressions in the end.

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

2016-03-22 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

--- Comment #2 from Martin Jambor  ---
The problem is that there is a PARM_DECL in the IL of the function
which is not listed among DECL_ARGUMENTS of the function:

The function we are in is:

(gdb) call debug_generic_expr(cfun->decl)
foo._omp_fn.0

but look at the context of the PARM_DECL in question:

(gdb) call debug_tree (op)
 
unit size 
align 32 symtab 0 alias set -1 canonical type 0x76891888 precision
32 min  max  context 
pointer_to_this >
addressable used unsigned SI file pr70348.c line 7 col 26 size  unit size 
align 32 context  arg-type >


Also, if you check the uid of the PARM_DECL:

(gdb) p op->decl_minimal.uid
$3 = 2907

you will see that it corresponds to a parameter the original function
foo, from which OpenACC outlined bits to foo._omp_fn.0:

   foo (intD.6 nD.2906, unsigned intD.9 sumD.2907)


And just by the way, because of the context mismatch, the testcase
ICEs in expand_expr_real_1 when compiled at -O0:

pr70348.c: In function ‘foo._omp_fn.0’:
pr70348.c:11:9: internal compiler error: in expand_expr_real_1, at expr.c:9651
 #pragma acc parallel reduction(+:sum)
 ^~~
0xa61521 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/mjambor/gcc/icln/src/gcc/expr.c:9645
0xa5a4c3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/home/mjambor/gcc/icln/src/gcc/expr.c:7962
0xa5178b store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
/home/mjambor/gcc/icln/src/gcc/expr.c:5406
0xa5039c expand_assignment(tree_node*, tree_node*, bool)
/home/mjambor/gcc/icln/src/gcc/expr.c:5175
0x90e4bc expand_gimple_stmt_1
/home/mjambor/gcc/icln/src/gcc/cfgexpand.c:3618
0x90e8ad expand_gimple_stmt
/home/mjambor/gcc/icln/src/gcc/cfgexpand.c:3714
0x9159be expand_gimple_basic_block
/home/mjambor/gcc/icln/src/gcc/cfgexpand.c:5720
0x917487 execute
/home/mjambor/gcc/icln/src/gcc/cfgexpand.c:6335

All in all, this is an OpenACC lowering/expansion bug.

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

2016-03-22 Thread tschwinge at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

Thomas Schwinge  changed:

   What|Removed |Added

   Keywords||openacc
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-03-22
 Ever confirmed|0   |1

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

2016-03-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

Richard Biener  changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu.org
   Target Milestone|--- |6.0

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

2016-03-21 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70348

vries at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
Summary|[openacc] ICE in|[6 Regression][openacc] ICE
   |visit_ref_for_mod_analysis, |in
   |at ipa-prop.c   |visit_ref_for_mod_analysis,
   ||at ipa-prop.c

--- Comment #1 from vries at gcc dot gnu.org ---
When removing the gang clause from the loop directive in the testcase, the
example compiles with the 5 branch, but ICEs with trunk. So, marking 6
regression.