diff options
Diffstat (limited to 'gcc/c-family/c-gimplify.c')
-rw-r--r-- | gcc/c-family/c-gimplify.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c index 9f79ccb..b919737 100644 --- a/gcc/c-family/c-gimplify.c +++ b/gcc/c-family/c-gimplify.c @@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "c-pretty-print.h" #include "cgraph.h" - +#include "cilk.h" /* The gimplification pass converts the language-dependent trees (ld-trees) emitted by the parser into language-independent trees @@ -207,6 +207,26 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, } break; } + + case CILK_SPAWN_STMT: + gcc_assert + (fn_contains_cilk_spawn_p (cfun) + && cilk_detect_spawn_and_unwrap (expr_p)); + + /* If errors are seen, then just process it as a CALL_EXPR. */ + if (!seen_error ()) + return (enum gimplify_status) gimplify_cilk_spawn (expr_p); + + case MODIFY_EXPR: + case INIT_EXPR: + case CALL_EXPR: + if (fn_contains_cilk_spawn_p (cfun) + && cilk_detect_spawn_and_unwrap (expr_p) + /* If an error is found, the spawn wrapper is removed and the + original expression (MODIFY/INIT/CALL_EXPR) is processes as + it is supposed to be. */ + && !seen_error ()) + return (enum gimplify_status) gimplify_cilk_spawn (expr_p); default:; } |