From eb87c7c4890b87d5f228b9261c2e3b3a5b81acd7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 13 Aug 2012 14:39:54 +0200 Subject: re PR c/53968 (integer undefined behaviors in GCC) PR c/53968 * tree.c (integer_pow2p): Avoid undefined signed overflows. * simplify-rtx.c (neg_const_int): Likewise. * expr.c (fixup_args_size_notes): Likewise. * stor-layout.c (set_min_and_max_values_for_integral_type): Likewise. * double-int.c (mul_double_wide_with_sign): Likewise. (double_int_mask): Likewise. * tree-ssa-loop-ivopts.c (get_address_cost): Likewise. From-SVN: r190342 --- gcc/simplify-rtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index f56a5ed..16dbd8a 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -66,7 +66,7 @@ static rtx simplify_binary_operation_1 (enum rtx_code, enum machine_mode, static rtx neg_const_int (enum machine_mode mode, const_rtx i) { - return gen_int_mode (- INTVAL (i), mode); + return gen_int_mode (-(unsigned HOST_WIDE_INT) INTVAL (i), mode); } /* Test whether expression, X, is an immediate constant that represents -- cgit v1.1