* combine.c (get_pos_from_mask): Test exact_log2 result as signed.

From-SVN: r34280
This commit is contained in:
Richard Henderson 2000-05-30 17:44:06 -07:00 committed by Richard Henderson
parent efc7058478
commit d3bc89386d
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2000-05-30 Richard Henderson <rth@cygnus.com>
* combine.c (get_pos_from_mask): Test exact_log2 result as signed.
2000-05-30 Richard Henderson <rth@cygnus.com>
* bb-reorder.c (emit_jump_to_block_after): Protect use of HAVE_return.

View File

@ -6588,17 +6588,19 @@ get_pos_from_mask (m, plen)
{
/* Get the bit number of the first 1 bit from the right, -1 if none. */
int pos = exact_log2 (m & - m);
int len;
if (pos < 0)
return -1;
/* Now shift off the low-order zero bits and see if we have a power of
two minus 1. */
*plen = exact_log2 ((m >> pos) + 1);
len = exact_log2 ((m >> pos) + 1);
if (*plen <= 0)
if (len <= 0)
return -1;
*plen = len;
return pos;
}