From cd480f3dfdd62706be9feb6f228a1eb2c1826ead Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 9 Jul 2014 17:14:11 +0000 Subject: 2014-07-09 Richard Biener 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 --- gcc/c-family/c-gimplify.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/c-family/c-gimplify.c') 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); } -- cgit v1.2.1