Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-30 Thread Tom de Vries
On 12/30/2017 10:54 AM, Jakub Jelinek wrote: On Fri, Dec 29, 2017 at 02:07:49PM +0100, Tom de Vries wrote: --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "gomp-constants.h" #inclu

Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-30 Thread Jakub Jelinek
On Fri, Dec 29, 2017 at 02:07:49PM +0100, Tom de Vries wrote: > --- a/gcc/lto-streamer-out.c > +++ b/gcc/lto-streamer-out.c > @@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see > #include "builtins.h" > #include "gomp-constants.h" > #include "debug.h" > +#include "omp-offload.h

Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-29 Thread Tom de Vries
On 12/28/2017 05:14 PM, Jakub Jelinek wrote: On Thu, Dec 28, 2017 at 05:06:57PM +0100, Jakub Jelinek wrote: This has O(n^2) complexity for n == vec_safe_length (offload_funcs). Can't you instead just have 2 IVs, one for where we read the vector elt and one for where we write it if the 2 are diff

Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-28 Thread Jakub Jelinek
On Thu, Dec 28, 2017 at 05:06:57PM +0100, Jakub Jelinek wrote: > This has O(n^2) complexity for n == vec_safe_length (offload_funcs). > Can't you instead just have 2 IVs, one for where we read the vector elt and > one for where we write it if the 2 are different, then truncate the vector > if neede

Re: [libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-28 Thread Jakub Jelinek
On Thu, Dec 28, 2017 at 04:53:29PM +0100, Tom de Vries wrote: > --- a/gcc/lto-cgraph.c > +++ b/gcc/lto-cgraph.c > @@ -,6 +,16 @@ output_offload_tables (void) >struct lto_simple_output_block *ob > = lto_create_simple_output_block (LTO_section_offload_table); > > + for (unsigned i

[libgomp, openacc, openmp, PR83046] Prune removed funcs from offload table

2017-12-28 Thread Tom de Vries
Hi, Consider this openmp example: ... /* { dg-do link } */ #define N 100 int main () { int a[N]; int i, x; int c; c = 1; #pragma omp target for (i = 0; i < 100; i++) a[i] = 0; if (c) __builtin_unreachable (); #pragma omp target for (i = 0; i < 100; i++) a[i] = 1;