summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-gimplify.c')
-rw-r--r--gcc/c-family/c-gimplify.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index d047c65b4ee..b919737b8ee 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
@@ -199,12 +199,34 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 0));
if (INTEGRAL_TYPE_P (type) && c_promoting_integer_type_p (type))
{
- if (TYPE_OVERFLOW_UNDEFINED (type))
+ if (TYPE_OVERFLOW_UNDEFINED (type)
+ || ((flag_sanitize & SANITIZE_SI_OVERFLOW)
+ && !TYPE_OVERFLOW_WRAPS (type)))
type = unsigned_type_for (type);
return gimplify_self_mod_expr (expr_p, pre_p, post_p, 1, type);
}
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:;
}