summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-19 21:27:51 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-19 21:27:51 +0000
commit60141df0b99ea85a2132e79c3ee2193d3ad31adc (patch)
tree0dd1c959d5fa1a9b4256002c3671f2654e454c31 /gcc/ifcvt.c
parentfafb2b1c87f0a52f04ffa8a8cc7a82fc20b308f6 (diff)
downloadgcc-60141df0b99ea85a2132e79c3ee2193d3ad31adc.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206134 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 569b9bf46c4..db5b8a23eb8 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1112,12 +1112,13 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
ifalse = INTVAL (if_info->a);
itrue = INTVAL (if_info->b);
+ diff = (unsigned HOST_WIDE_INT) itrue - ifalse;
/* Make sure we can represent the difference between the two values. */
- if ((itrue - ifalse > 0)
+ if ((diff > 0)
!= ((ifalse < 0) != (itrue < 0) ? ifalse < 0 : ifalse < itrue))
return FALSE;
- diff = trunc_int_for_mode (itrue - ifalse, mode);
+ diff = trunc_int_for_mode (diff, mode);
can_reverse = (reversed_comparison_code (if_info->cond, if_info->jump)
!= UNKNOWN);
@@ -1148,7 +1149,7 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
if (reversep)
{
tmp = itrue; itrue = ifalse; ifalse = tmp;
- diff = trunc_int_for_mode (-diff, mode);
+ diff = trunc_int_for_mode (-(unsigned HOST_WIDE_INT) diff, mode);
}
start_sequence ();