This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi! On Mon, 18 Aug 2014 20:07:59 +0400, Ilya Verbin <iverbin@gmail.com> wrote: > I discovered an issue in the LTO streaming out for target - currently any file (even without any pragma) compiled with -fopenmp/-fopenacc contains .gnu.target_lto_* sections. This increases the size of an object file and makes lto-wrapper to run mkoffload. > > Therefore, I propose to replace the condition before ipa_write_summaries: > - if (flag_openacc || flag_openmp) > + if ((flag_openacc || flag_openmp) && !(vec_safe_is_empty (offload_funcs) && vec_safe_is_empty (offload_vars))) > > But to do this, the offload_vars must be filled before the check (offload_funcs is already filled in expand_omp_target). > Here is the updated patch. Bootstrap passed. OK for gomp-4_0-branch? > > > On 13 Aug 20:19, Ilya Verbin wrote: > > Here is the updated patch. offload_funcs/vars are now declared in omp-low.h, > > the functions have a comment. Also it fixes the issue of offload_funcs/vars > > corruption by the garbage collector. OK for gomp-4_0-branch? > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -8906,6 +8909,9 @@ expand_omp_target (struct omp_region *region) > DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties; > cgraph_add_new_function (child_fn, true); > > + /* Add the new function to the offload table. */ > + vec_safe_push (offload_funcs, child_fn); > + > /* Fix the callgraph edges for child_cfun. Those for cfun will be > fixed in a following pass. */ > push_cfun (child_cfun); The same change needs to be done for OpenACC offloading; addressed in r214892: commit 9fb900482bd3bca9bfa89301e417174caabd7176 Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed Sep 3 19:10:43 2014 +0000 Restore OpenACC offloading. gcc/ * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@214892 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 4 ++++ gcc/omp-low.c | 3 +++ 2 files changed, 7 insertions(+) diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index 40688df..0c55814 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,7 @@ +2014-09-03 Thomas Schwinge <thomas@codesourcery.com> + + * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs. + 2014-08-19 Ilya Verbin <ilya.verbin@intel.com> * Makefile.in (GTFILES): Add omp-low.h. diff --git gcc/omp-low.c gcc/omp-low.c index 1ad98ab..6ed8239 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -5351,6 +5351,9 @@ expand_oacc_offload (struct omp_region *region) DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties; cgraph_add_new_function (child_fn, true); + /* Add the new function to the offload table. */ + vec_safe_push (offload_funcs, child_fn); + /* Fix the callgraph edges for child_cfun. Those for cfun will be fixed in a following pass. */ push_cfun (child_cfun); GrÃÃe, Thomas
Attachment:
pgpjH6hq80F7H.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |