This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR70729] The second part of patch.
- From: Yuri Rumyantsev <ysrumyan at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Igor Zamyatin <izamyatin at gmail dot com>, ÐÐÑÑ ÐÐÐÐÐÐÑ <enkovich dot gnu at gmail dot com>
- Date: Thu, 30 Jun 2016 16:48:25 +0300
- Subject: Re: [PATCH PR70729] The second part of patch.
- Authentication-results: sourceware.org; auth=none
- References: <CAEoMCqSx5+c2N9UpvbntYPaTxcBwzk3pAY+Kfc9wFVQp8qDMbA at mail dot gmail dot com> <87eg7gt1bw dot fsf at kepler dot schwinge dot homeip dot net> <CAEoMCqQ6WEO2p0DzbtSuxjbn10=b-0kJXx4tqzXuz16rb7=igg at mail dot gmail dot com> <20160630122145 dot GM7387 at tucnak dot redhat dot com>
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 <jakub@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