Bug 84466 - [8 regression] libgomp.graphite/force-parallel-8.c fails starting with r257723
Summary: [8 regression] libgomp.graphite/force-parallel-8.c fails starting with r257723
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-19 15:39 UTC by seurer
Modified: 2018-02-27 14:46 UTC (History)
3 users (show)

See Also:
Host: powerpc64*-*-*
Target: powerpc64*-*-*
Build: powerpc64*-*-*
Known to work:
Known to fail:
Last reconfirmed: 2018-02-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2018-02-19 15:39:23 UTC
I am seeing this on powerpc64 both LE and BE.

spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc -B/home/seurer/gcc/build/gcc-test2/gcc/ /home/seurer/gcc/gcc-test2/libgomp/testsuite/libgomp.graphite/force-parallel-8.c -B/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp/ -B/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp/.libs -I/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp -I/home/seurer/gcc/gcc-test2/libgomp/testsuite/../../include -I/home/seurer/gcc/gcc-test2/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -Wno-hsa -fdiagnostics-color=never -fopenmp -ansi -pedantic-errors -O2 -ftree-parallelize-loops=4 -floop-parallelize-all -fdump-tree-parloops-details -fdump-tree-optimized -fno-loop-strip-mine -fno-loop-block -fdump-tree-graphite-all -L/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp/.libs -lm -o ./force-parallel-8.exe
PASS: libgomp.graphite/force-parallel-8.c (test for excess errors)
Setting LD_LIBRARY_PATH to .:/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp/.libs:/home/seurer/gcc/build/gcc-test2/gcc:/home/seurer/gcc/build/gcc-test2/gcc/32:.:/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/./libgomp/.libs:/home/seurer/gcc/build/gcc-test2/gcc:/home/seurer/gcc/build/gcc-test2/gcc/32:/home/seurer/gcc/build/gcc-test2/./gmp/.libs:/home/seurer/gcc/build/gcc-test2/./prev-gmp/.libs:/home/seurer/gcc/build/gcc-test2/./mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./isl/.libs:/home/seurer/gcc/build/gcc-test2/./prev-isl/.libs:/home/seurer/gcc/install/gcc-6.3.0/lib64
spawn [open ...]
PASS: libgomp.graphite/force-parallel-8.c execution test
FAIL: libgomp.graphite/force-parallel-8.c scan-tree-dump-times graphite "5 loops carried no dependency" 1 (found 0 times)
PASS: libgomp.graphite/force-parallel-8.c scan-tree-dump-times optimized "loopfn.0" 4
PASS: libgomp.graphite/force-parallel-8.c scan-tree-dump-times optimized "loopfn.1" 4
testcase /home/seurer/gcc/gcc-test2/libgomp/testsuite/libgomp.graphite/graphite.exp completed in 2 seconds

		=== libgomp Summary ===

# of expected passes		4
# of unexpected failures	1
Comment 1 John David Anglin 2018-02-19 21:37:35 UTC
Also seen on hppa-unknown-linux-gnu.  Only 3 loops carried no dependency.
Comment 2 Richard Biener 2018-02-26 09:16:41 UTC
Mine.
Comment 3 Andrey Guskov 2018-02-26 18:17:08 UTC
Confirmed on Intel Silvermont.
Comment 4 Richard Biener 2018-02-27 10:43:45 UTC
So the issue is

  for (i = 0; i < N; i++)
    {
      y[i] = i;

      for (j = 0; j < N; j++)
        {
          if (j > 500)
            {
              x[i][j] = i + j + 3;
              y[j] = i*j + 10;
^^^

here we now verify that we can instantiate i*j + 10 at this point which
is (int) {10, +, {0, +, 1}_3}_4 and that fails the graphite_can_represent_scev
test because of

    case POLYNOMIAL_CHREC:
      /* Check for constant strides.  With a non constant stride of
         'n' we would have a value of 'iv * n'.  Also check that the
         initial value can represented: for example 'n * m' cannot be
         represented.  */
      gcc_assert (loop_in_sese_p (get_loop (cfun,
                                            CHREC_VARIABLE (scev)), scop));
      if (!evolution_function_right_is_integer_cst (scev)
          || !graphite_can_represent_init (scev))
        return false;

given CHREC_RIGHT is {0, +, 1}_3 and not an INTEGER_CST.

I think with graphite_can_represent_scev I used the wrong tool (it is supposed
to guard what extract_affine handles).  Testing a patch.
Comment 5 Richard Biener 2018-02-27 14:45:47 UTC
Fixed.
Comment 6 Richard Biener 2018-02-27 14:46:18 UTC
Author: rguenth
Date: Tue Feb 27 14:45:46 2018
New Revision: 258035

URL: https://gcc.gnu.org/viewcvs?rev=258035&root=gcc&view=rev
Log:
2018-02-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84466
	* graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p):
	Adjust last change to less strictly validate use operands.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/graphite-scop-detection.c