Hi Jacub, Thanks for your help. Could you please look at the following simple patch which cures regression - we need to nullify loop safelen field in adjust_simduid_builtins:
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 2669813..f70380c 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -204,6 +204,10 @@ adjust_simduid_builtins (hash_table<simduid_to_vf> *htab) gcc_assert (TREE_CODE (arg) == SSA_NAME); simduid_to_vf *p = NULL, data; data.simduid = DECL_UID (SSA_NAME_VAR (arg)); + /* Need to nullify safelen fielf of loop since it's vale is not + valid after transformation. */ + if (bb->loop_father && bb->loop_father->safelen > 0) + bb->loop_father->safelen = 0; if (htab) { p = htab->find (&data); Thanks. Yuri. 2016-06-30 15:21 GMT+03:00 Jakub Jelinek <ja...@redhat.com>: > On Thu, Jun 30, 2016 at 03:16:51PM +0300, Yuri Rumyantsev wrote: >> Hi Grüße. >> >> Could you please tell me how to reproduce your regression - did not >> see any new failures in my local area: >> >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O0 (test for excess errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O0 execution test >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O1 (test for excess errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O1 execution test >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O2 (test for excess errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O2 execution test >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O3 -fomit-frame-pointer >> -funroll-loops -fpeel-loops -ftracer -finline-functions (test for >> excess errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O3 -fomit-frame-pointer >> -funroll-loops -fpeel-loops -ftracer -finline-functions execution >> test >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O3 -g (test for excess >> errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -O3 -g execution test >> PASS: libgomp.fortran/examples-4/simd-2.f90 -Os (test for excess errors) >> PASS: libgomp.fortran/examples-4/simd-2.f90 -Os execution test >> >> I used HASWELL machine for it since test requires target avx. > > It fails everywhere for me, without offloading configured, both 32-bit and > 64-bit. > $ /home/jakub/src/gcc/obj20/gcc/xgcc -B/home/jakub/src/gcc/obj20/gcc/ > ../../../../libgomp/testsuite/libgomp.fortran/examples-4/simd-2.f90 > -B/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/ > -B/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/.libs > -I/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp > -I../../../../libgomp/testsuite/../../include > -I../../../../libgomp/testsuite/.. -fmessage-length=0 > -fno-diagnostics-show-caret -Wno-hsa -fdiagnostics-color=never -fopenmp > -B/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/../libquadmath/.libs/ > -O2 -msse2 -mavx > -B/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/../libgfortran/.libs > > -fintrinsic-modules-path=/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp > -L/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/.libs > -L/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/../libquadmath/.libs/ > > -L/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/./libgomp/../libgfortran/.libs > -lgfortran -lm -o ./simd-2.exe -Wl,-rpath,../.libs/ -march=haswell > $ ./simd-2.exe > > Program received signal SIGSEGV: Segmentation fault - invalid memory > reference. > > Backtrace for this error: > #0 0x7F7548CDBD58 > #1 0x7F7548CDAEE0 > #2 0x3405234A4F > #3 0x400849 in __simd2_mod_MOD_work > #4 0x4008D4 in MAIN__ at simd-2.f90:? > Segmentation fault (core dumped) > > With/without -march=haswell, -mtune=haswell etc. > > Jakub