diff options
author | Marek Polacek <mpolacek@gcc.gnu.org> | 2013-12-04 22:47:11 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2013-12-04 22:47:11 +0000 |
commit | 31e071aeb827f49ce2e891620852198e99d44a0c (patch) | |
tree | 20fca81276f1e6d6224300c11a4e10fa89519d41 /gcc/c-family/c-gimplify.c | |
parent | 59b6687cceaf95d8c49afee88248cf4fb0a33105 (diff) | |
download | gcc-31e071aeb827f49ce2e891620852198e99d44a0c.zip gcc-31e071aeb827f49ce2e891620852198e99d44a0c.tar.gz gcc-31e071aeb827f49ce2e891620852198e99d44a0c.tar.bz2 |
Implement -fsanitize=signed-integer-overflow.
From-SVN: r205684
Diffstat (limited to 'gcc/c-family/c-gimplify.c')
-rw-r--r-- | gcc/c-family/c-gimplify.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c index d047c65..9f79ccb 100644 --- a/gcc/c-family/c-gimplify.c +++ b/gcc/c-family/c-gimplify.c @@ -199,7 +199,9 @@ 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); } |