This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR 70857] Copy RESULT_DECL of HSA outlined kernel function
- From: Jakub Jelinek <jakub at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 May 2016 16:26:56 +0200
- Subject: Re: [PR 70857] Copy RESULT_DECL of HSA outlined kernel function
- Authentication-results: sourceware.org; auth=none
- References: <20160516142510 dot GM5580 at virgil dot suse dot cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, May 16, 2016 at 04:25:10PM +0200, Martin Jambor wrote:
> the patch below fixes PR 70857. When the HSA gridification code
> copies the declaration of the function for outlining the target
> construct, it left the old RESULT_DECL dangling to it. I did not
> notice because it has VOID_TYPE but it needs to be done nevertheless,
> not least because ipa-pta chokes on it.
>
> Bootstrapped and tested on x86_64 with hsa enabled. OK for trunk and
> the gcc-6 branch?
>
> Thanks,
>
> Martin
>
> 2016-05-12 Martin Jambor <mjambor@suse.cz>
>
> PR hsa/70857
> * omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of
> the outlined kernel function.
Ok.
> diff --git a/gcc/omp-low.c b/gcc/omp-low.c
> index c9600fb..a11f44b 100644
> --- a/gcc/omp-low.c
> +++ b/gcc/omp-low.c
> @@ -13681,6 +13681,9 @@ grid_expand_target_grid_body (struct omp_region *target)
> tree new_parm_decl = copy_node (DECL_ARGUMENTS (kern_fndecl));
> DECL_CONTEXT (new_parm_decl) = kern_fndecl;
> DECL_ARGUMENTS (kern_fndecl) = new_parm_decl;
> + gcc_assert (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (kern_fndecl))));
> + DECL_RESULT (kern_fndecl) = copy_node (DECL_RESULT (kern_fndecl));
> + DECL_CONTEXT (DECL_RESULT (kern_fndecl)) = kern_fndecl;
> struct function *kern_cfun = DECL_STRUCT_FUNCTION (kern_fndecl);
> kern_cfun->curr_properties = cfun->curr_properties;
>
> --
> 2.8.2
Jakub