In the graphite branch some programs do not pass the legality check with the following flags: $ gcc -O3 -fgraphite -fno-loop-block run-id-pr42644.c When executed, the program cannot pass any legality check similar to : gcc_assert (graphite_legal_transform (scop)); Test files that have the same problem are : id-17.c id-1.c pr37828.c pr38510.c pr38786.c pr39335_1.c pr39335.c pr42211.c run-id-pr42644.c To produce the error you'll need to insert this test manually since the test is not accessible by default. (it's called when you activate the option -fgraphite-write, and after code transformation, code transformation make the check pass but if the check is inserted before code transformation, there will be an error). The same bug was also there without when I use a graphite version without any recent OpenScop patches, so it's not related to recent changes by OpenScop patches.
I went to investigate this bug, and I found out that inserting gcc_assert (graphite_legal_transform (scop)); is invalid: the legality function is not supposed to return true when the dependence analysis cannot be performed at compile time. On the particular case of id-1.c, we have this code: lambda_vector_add_mc (lambda_vector vec1, int const1, lambda_vector vec2, int const2, lambda_vector vec3, int size) { int i; for (i = 0; i < size; i++) vec3[i] = const1 * vec1[i] + const2 * vec2[i]; } and the assert would fail because the dependence analysis returns a relation classified as unknown because it is not possible to prove that vec1 and vec3 do not alias: if (!(pdr_read_p (pdr1) && pdr_read_p (pdr2)) && PDR_BASE_OBJECT_SET (pdr1) != PDR_BASE_OBJECT_SET (pdr2) && may_alias) PDDR_KIND (res) = unknown_dependence; I investigated the other fails that I can see today on trunk: FAIL: gcc.dg/graphite/scop-matmult.c (internal compiler error) FAIL: gcc.dg/graphite/scop-mvt.c (internal compiler error) FAIL: gcc.dg/graphite/id-1.c (internal compiler error) FAIL: gcc.dg/graphite/run-id-pr42644.c (internal compiler error) FAIL: gcc.dg/graphite/interchange-14.c (internal compiler error) FAIL: gcc.dg/graphite/interchange-15.c (internal compiler error) FAIL: gcc.dg/graphite/interchange-mvt.c (internal compiler error) FAIL: gcc.dg/graphite/pr31183.c (internal compiler error) FAIL: gcc.dg/graphite/pr38510.c (internal compiler error) FAIL: gcc.dg/graphite/pr38786.c (internal compiler error) FAIL: gcc.dg/graphite/pr42211.c (internal compiler error) FAIL: libgomp.graphite/pr41118.c (internal compiler error) FAIL: gfortran.dg/graphite/pr29581.f90 -O0 (internal compiler error) FAIL: gfortran.dg/graphite/pr29832.f90 -O0 (internal compiler error) FAIL: gfortran.dg/graphite/pr42334-1.f -O (internal compiler error) FAIL: gfortran.dg/graphite/pr42393-1.f90 -O (internal compiler error) FAIL: gfortran.dg/graphite/pr42393.f90 -O (internal compiler error) when run in gdb, they all break on the statement before ICE-ing: PDDR_KIND (res) = unknown_dependence; I am closing this bug as invalid.
Author: spop Date: Wed Jul 27 16:53:02 2011 New Revision: 176837 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176837 Log: PR45450: disable legality check after an openscop read 2011-07-27 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/45450 * graphite-poly.c (apply_poly_transforms): Disable legality check after an openscop read. Modified: trunk/gcc/ChangeLog trunk/gcc/graphite-poly.c