aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-12-19 22:27:51 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-12-19 22:27:51 +0100
commite15eb172b0dd7451f121c908a97ab86a45759993 (patch)
tree0dd1c959d5fa1a9b4256002c3671f2654e454c31 /gcc/stor-layout.c
parentd8d79c1df220d94f4c285e0a6e1e750bfb488d78 (diff)
downloadgcc-e15eb172b0dd7451f121c908a97ab86a45759993.zip
gcc-e15eb172b0dd7451f121c908a97ab86a45759993.tar.gz
gcc-e15eb172b0dd7451f121c908a97ab86a45759993.tar.bz2
re PR other/59545 (Signed integer overflow issues)
PR other/59545 * genattrtab.c (struct attr_hash): Change hashcode type to unsigned. (attr_hash_add_rtx, attr_hash_add_string): Change hashcode parameter to unsigned. (attr_rtx_1): Change hashcode variable to unsigned. (attr_string): Likewise. Perform first multiplication in unsigned type. * ifcvt.c (noce_try_store_flag_constants): Avoid signed integer overflows. * double-int.c (neg_double): Likewise. * stor-layout.c (set_min_and_max_values_for_integral_type): Likewise. * combine.c (force_to_mode): Likewise. * postreload.c (move2add_use_add2_insn, move2add_use_add3_insn, reload_cse_move2add, move2add_note_store): Likewise. * simplify-rtx.c (simplify_const_unary_operation, simplify_const_binary_operation): Likewise. * ipa-split.c (find_split_points): Initialize first.can_split and first.non_ssa_vars. * gengtype-state.c (read_state_files_list): Fix up check. * genautomata.c (reserv_sets_hash_value): Use portable rotation idiom. java/ * class.c (hashUtf8String): Compute hash in unsigned type. * javaop.h (WORD_TO_INT): Avoid signed integer overflow. From-SVN: r206134
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 9325525..675a123 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -2521,7 +2521,7 @@ set_min_and_max_values_for_integral_type (tree type,
max_value
= build_int_cst_wide (type, precision - HOST_BITS_PER_WIDE_INT >= 0
? -1
- : ((HOST_WIDE_INT) 1 << precision) - 1,
+ : (HOST_WIDE_INT_1U << precision) - 1,
precision - HOST_BITS_PER_WIDE_INT > 0
? ((unsigned HOST_WIDE_INT) ~0
>> (HOST_BITS_PER_WIDE_INT
@@ -2534,7 +2534,7 @@ set_min_and_max_values_for_integral_type (tree type,
= build_int_cst_wide (type,
(precision - HOST_BITS_PER_WIDE_INT > 0
? 0
- : (HOST_WIDE_INT) (-1) << (precision - 1)),
+ : HOST_WIDE_INT_M1U << (precision - 1)),
(((HOST_WIDE_INT) (-1)
<< (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
? precision - HOST_BITS_PER_WIDE_INT - 1