From 636542efb52ab08939b4c77f90b6cf373ad7058f Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Mon, 16 May 2016 17:40:30 +0200 Subject: [PATCH] [PR 70857] Copy RESULT_DECL of HSA outlined kernel function 2016-05-16 Martin Jambor PR hsa/70857 * omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of the outlined kernel function. From-SVN: r236291 --- gcc/ChangeLog | 6 ++++++ gcc/omp-low.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef550790b0a..0f06f1d79cc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-16 Martin Jambor + + PR hsa/70857 + * omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of + the outlined kernel function. + 2016-05-16 Robert Suchanek * config/mips/mips.h (ISA_HAS_LSA): Enable for -mmsa. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index c9600fb6d33..a11f44b84a7 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;