From: Yuri Rumyantsev Date: Mon, 18 Jul 2016 14:30:20 +0000 (+0000) Subject: re PR middle-end/71734 (FAIL: libgomp.fortran/simd4.f90 -O3 -g execution test) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94e136b95b163c60090dc0a711b07de03649aca1;p=gcc.git re PR middle-end/71734 (FAIL: libgomp.fortran/simd4.f90 -O3 -g execution test) gcc/ 2016-07-18 Yuri Rumyantsev PR tree-optimization/71734 * tree-ssa-loop-im.c (ref_indep_loop_p_1): Add REF_LOOP argument which contains REF, use it to check safelen, assume that safelen value must be greater 1, fix style. (ref_indep_loop_p_2): Add REF_LOOP argument. (ref_indep_loop_p): Pass LOOP as additional argument to ref_indep_loop_p_2. gcc/testsuite/ 2016-07-18 Yuri Rumyantsev PR tree-optimization/71734 * g++.dg/vect/pr70729.cc: Delete redundant dg options, fix style. From-SVN: r238435 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69d1e56fb49..3f24fab978d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-07-18 Yuri Rumyantsev + + PR tree-optimization/71734 + * tree-ssa-loop-im.c (ref_indep_loop_p_1): Add REF_LOOP argument which + contains REF, use it to check safelen, assume that safelen value + must be greater 1, fix style. + (ref_indep_loop_p_2): Add REF_LOOP argument. + (ref_indep_loop_p): Pass LOOP as additional argument to + ref_indep_loop_p_2. + 2016-07-18 Dominik Vogt * cfgexpand.c (expand_stack_vars): Implement synamic stack space diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00dacc4b741..30e214aabc0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-18 Yuri Rumyantsev + + PR tree-optimization/71734 + * g++.dg/vect/pr70729.cc: Delete redundant dg options, fix style. + 2016-07-18 Dominik Vogt * gcc.target/s390/warn-dynamicstack-1.c: New test. diff --git a/gcc/testsuite/g++.dg/vect/pr70729.cc b/gcc/testsuite/g++.dg/vect/pr70729.cc index 0d5d353faeb..014de8c1c47 100644 --- a/gcc/testsuite/g++.dg/vect/pr70729.cc +++ b/gcc/testsuite/g++.dg/vect/pr70729.cc @@ -1,14 +1,13 @@ // { dg-do compile } -// { dg-require-effective-target vect_simd_clones } -// { dg-additional-options "-Ofast" } -// { dg-additional-options "-mavx2 -fopenmp-simd" { target x86_64-*-* i?86-*-* } } +// { dg-additional-options "-ffast-math -fopenmp-simd" } +// { dg-additional-options "-msse2" { target x86_64-*-* i?86-*-* } } #include #include -inline void* my_alloc(size_t bytes) {return _mm_malloc(bytes, 128);} -inline void my_free(void* memory) {_mm_free(memory);} +inline void* my_alloc (size_t bytes) {return _mm_malloc (bytes, 128);} +inline void my_free (void* memory) {_mm_free (memory);} template class Vec @@ -18,13 +17,13 @@ class Vec public: - Vec (int n) : isize(n) {data = (T*)my_alloc(isize*sizeof(T));} + Vec (int n) : isize (n) {data = (T*)my_alloc (isize*sizeof (T));} ~Vec () {my_free(data);} Vec& operator = (const Vec& other) { if (this != &other) - memcpy(data, other.data, isize*sizeof(T)); + memcpy (data, other.data, isize*sizeof (T)); return *this; } @@ -67,7 +66,7 @@ struct Ss void Ss::foo (float *in, float w) { #pragma omp simd - for (int i=0; isafelen > 0) + if (ref_loop->safelen > 1) { if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf(dump_file,"Consider REF independent in loop#%d\n", loop->num); - print_generic_expr(dump_file, ref->mem.ref, TDF_SLIM); - fprintf(dump_file, "\n"); + fprintf (dump_file,"REF is independent in ref_loop#%d\n", + ref_loop->num); + print_generic_expr (dump_file, ref->mem.ref, TDF_SLIM); + fprintf (dump_file, "\n"); } return true; } @@ -2149,11 +2151,13 @@ ref_indep_loop_p_1 (struct loop *loop, im_mem_ref *ref, bool stored_p) return true; } -/* Returns true if REF is independent on all other memory references in - LOOP. Wrapper over ref_indep_loop_p_1, caching its results. */ +/* Returns true if REF in REF_LOOP is independent on all other memory + references in LOOP. Wrapper over ref_indep_loop_p_1, caching its + results. */ static bool -ref_indep_loop_p_2 (struct loop *loop, im_mem_ref *ref, bool stored_p) +ref_indep_loop_p_2 (struct loop *ref_loop, struct loop *loop, + im_mem_ref *ref, bool stored_p) { stored_p |= (ref->stored && bitmap_bit_p (ref->stored, loop->num)); @@ -2165,12 +2169,12 @@ ref_indep_loop_p_2 (struct loop *loop, im_mem_ref *ref, bool stored_p) struct loop *inner = loop->inner; while (inner) { - if (!ref_indep_loop_p_2 (inner, ref, stored_p)) + if (!ref_indep_loop_p_2 (ref_loop, inner, ref, stored_p)) return false; inner = inner->next; } - bool indep_p = ref_indep_loop_p_1 (loop, ref, stored_p); + bool indep_p = ref_indep_loop_p_1 (ref_loop, loop, ref, stored_p); if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Querying dependencies of ref %u in loop %d: %s\n", @@ -2209,7 +2213,7 @@ ref_indep_loop_p (struct loop *loop, im_mem_ref *ref) { gcc_checking_assert (MEM_ANALYZABLE (ref)); - return ref_indep_loop_p_2 (loop, ref, false); + return ref_indep_loop_p_2 (loop, loop, ref, false); } /* Returns true if we can perform store motion of REF from LOOP. */