Mercurial > hg > CbC > CbC_gcc
diff gcc/hwint.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/hwint.c Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/hwint.c Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ /* Operations on HOST_WIDE_INT. - Copyright (C) 1987-2017 Free Software Foundation, Inc. + Copyright (C) 1987-2018 Free Software Foundation, Inc. This file is part of GCC. @@ -60,12 +60,12 @@ return t; } -/* Given X, an unsigned number, return the largest Y such that 2**Y >= X. */ +/* Given X, an unsigned number, return the least Y such that 2**Y >= X. */ int ceil_log2 (unsigned HOST_WIDE_INT x) { - return floor_log2 (x - 1) + 1; + return x == 0 ? 0 : floor_log2 (x - 1) + 1; } /* Return the logarithm of X, base 2, considering X unsigned,