Commit 188235df by Richard Henderson Committed by Richard Henderson

ifcvt.c (noce_try_store_flag_constants): Test for overflow in computing DIFF.

        * ifcvt.c (noce_try_store_flag_constants): Test for overflow
        in computing DIFF.

From-SVN: r47374
parent d99b0e79
2001-11-27 Richard Henderson <rth@redhat.com>
* ifcvt.c (noce_try_store_flag_constants): Test for overflow
in computing DIFF.
2001-11-27 Zack Weinberg <zack@codesourcery.com> 2001-11-27 Zack Weinberg <zack@codesourcery.com>
* cppfiles.c (read_include_file): Add comment. * cppfiles.c (read_include_file): Add comment.
......
...@@ -650,6 +650,12 @@ noce_try_store_flag_constants (if_info) ...@@ -650,6 +650,12 @@ noce_try_store_flag_constants (if_info)
mode = GET_MODE (if_info->x); mode = GET_MODE (if_info->x);
ifalse = INTVAL (if_info->a); ifalse = INTVAL (if_info->a);
itrue = INTVAL (if_info->b); itrue = INTVAL (if_info->b);
/* Make sure we can represent the difference between the two values. */
if ((itrue - ifalse > 0)
!= ((ifalse < 0) != (itrue < 0) ? ifalse < 0 : ifalse < itrue))
return FALSE;
diff = trunc_int_for_mode (itrue - ifalse, mode); diff = trunc_int_for_mode (itrue - ifalse, mode);
can_reverse = (reversed_comparison_code (if_info->cond, if_info->jump) can_reverse = (reversed_comparison_code (if_info->cond, if_info->jump)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment