diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-09 17:14:11 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-09 17:14:11 +0000 |
commit | cd480f3dfdd62706be9feb6f228a1eb2c1826ead (patch) | |
tree | 1ff9d46ac3b6ed25a449b7d7eb8d7f13bd233a4b /gcc/c-family/c-gimplify.c | |
parent | 251d049af81fe9a866015bae80717d7b214d7fb2 (diff) | |
download | gcc-cd480f3dfdd62706be9feb6f228a1eb2c1826ead.tar.gz |
2014-07-09 Richard Biener <rguenther@suse.de>
PR c-family/61741
* c-gimplify.c (c_gimplify_expr): Gimplify self-modify expressions
using unsigned arithmetic if overflow does not wrap instead of
if overflow is undefined.
* c-c++-common/torture/pr61741.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-gimplify.c')
-rw-r--r-- | gcc/c-family/c-gimplify.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c index 16bffd297bd..8fbff603ca8 100644 --- a/gcc/c-family/c-gimplify.c +++ b/gcc/c-family/c-gimplify.c @@ -240,9 +240,7 @@ 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) - || ((flag_sanitize & SANITIZE_SI_OVERFLOW) - && !TYPE_OVERFLOW_WRAPS (type))) + if (!TYPE_OVERFLOW_WRAPS (type)) type = unsigned_type_for (type); return gimplify_self_mod_expr (expr_p, pre_p, post_p, 1, type); } |