[Bug middle-end/68733] [6 Regression] FAIL: libgomp.c/target-29.c (internal compiler error)

2016-01-13 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68733

--- Comment #3 from John David Anglin  ---
*** Bug 68245 has been marked as a duplicate of this bug. ***

[Bug middle-end/68733] [6 Regression] FAIL: libgomp.c/target-29.c (internal compiler error)

2016-01-12 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68733

Jeffrey A. Law  changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||law at redhat dot com

[Bug middle-end/68733] [6 Regression] FAIL: libgomp.c/target-29.c (internal compiler error)

2015-12-10 Thread dave.anglin at bell dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68733

--- Comment #2 from dave.anglin at bell dot net ---
On 2015-12-10, at 12:31 PM, jakub at gcc dot gnu.org wrote:

> Has OpenMP ever worked on PA?

Likely not.

Although the issue is not exposed in the libgomp for earlier gcc versions, I
came across the problem looking
at build results of the Debian cdo package on hppa:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../libcdi/src
-I/usr/include/magics
 -I/usr/include -I/usr/include -I/usr/include -I/usr/include
-I/usr/lib/hppa-lin
ux-gnu/hdf5/serial/include -I/usr/include -D_FORTIFY_SOURCE=2 -DgFortran
-I/usr/
include -g -O2 -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
-
MT libcdo_la-remaplib.lo -MD -MP -MF .deps/libcdo_la-remaplib.Tpo -c remaplib.c 
 -fPIC -DPIC -o .libs/libcdo_la-remaplib.o
remaplib.c:338:6: warning: ‘check_lon_range2’ defined but not used
[-Wunused-fun
ction]
 void check_lon_range2(long nc, long nlons, double *corners, double *centers)
  ^
remaplib.c: In function ‘remap_gradients’:
remaplib.c:1602:16: error: ‘grid.124’ not specified in enclosing parallel
   if ( grid.mask[n] )
^
remaplib.c:1592:9: error: enclosing parallel
 #pragma omp parallel for default(none)\

Copying the argument "grid" to a local fixed the build error.

> The OpenMP gimplification is unprepared to see the result of
> gimplify_parameters
> if reference_callee_copied is true on some parameter. 

--
John David Anglin   dave.ang...@bell.net

[Bug middle-end/68733] [6 Regression] FAIL: libgomp.c/target-29.c (internal compiler error)

2015-12-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68733

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||rth at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Has OpenMP ever worked on PA?
The OpenMP gimplification is unprepared to see the result of
gimplify_parameters
if reference_callee_copied is true on some parameter.  But it is far from just
the target construct, for which I've tried something like:
--- gimplify.c.jj   2015-12-04 17:19:12.0 +0100
+++ gimplify.c  2015-12-10 18:02:03.224659575 +0100
@@ -6836,6 +6836,18 @@ gimplify_scan_omp_clauses (tree *list_p,
  machine_mode mode;
  int unsignedp, reversep, volatilep = 0;
  tree base = OMP_CLAUSE_DECL (c);
+ /* Undo DECL_VALUE_EXPR expansion of the base.  */
+ if (DECL_HAS_VALUE_EXPR_P (decl))
+   {
+ tree *p = _CLAUSE_DECL (c);
+ while (TREE_CODE (*p) == ARRAY_REF)
+   p = _OPERAND (*p, 0);
+ if (TREE_CODE (*p) == INDIRECT_REF)
+   p = _OPERAND (*p, 0);
+ while (handled_component_p (*p))
+   p = _OPERAND (*p, 0);
+ *p = decl;
+   }
  while (TREE_CODE (base) == ARRAY_REF)
base = TREE_OPERAND (base, 0);
  if (TREE_CODE (base) == INDIRECT_REF)
I probably can't just disable DECL_HAS_VALUE_EXPR_P temporarily, because if
there is say map(tofrom:s.d[s.i + 1:s.j - 2]) then we want to expand s.i and
s.j into s.0.i and s.1.j.
But, looking at trivial testcase like:
struct S { char p[64]; int a; int b[2]; long c[4]; int *d; char q[64]; };

__attribute__((noinline, noclone)) void
foo (struct S s)
{
  #pragma omp parallel private (s)
  {
s.a = 5;
s.b[0] = 6;
  }
}
I see
__attribute__((noclone, noinline))
foo (struct S s)
{
  struct S s.0;

  s.0 = s;
  #pragma omp parallel private(s) shared(s.0)
{
  s.0.a = 5;
  s.0.b[0] = 6;
}
}
in gimple dump, which means that user said the var should be privatized, but in
reality the other var is used and is shared, so PA must be full of data races
in OpenMP code.
Not sure what exactly to do here though, supposedly we want to arrange for such
callee copies parameters to disregard value exprs in the bodies of OpenMP
constructs, but not sure how to reliably detect those PARM_DECLs.
Richard, any thoughts on this?

[Bug middle-end/68733] [6 Regression] FAIL: libgomp.c/target-29.c (internal compiler error)

2015-12-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68733

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.0
Summary|FAIL: libgomp.c/target-29.c |[6 Regression] FAIL:
   |(internal compiler error)   |libgomp.c/target-29.c
   ||(internal compiler error)