From: Richard Sandiford Date: Mon, 30 Jul 2018 11:23:26 +0000 (+0000) Subject: Resync inline implementation of ceil_log2 (PR 86506) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1dcadcf01d48dda372630478140e3fb4f6bc73ee;p=gcc.git Resync inline implementation of ceil_log2 (PR 86506) In r262961 I only updated the out-of-line copy of ceil_log2. This patch applies the same change to the other (inline) one. 2018-07-30 Richard Sandiford gcc/ PR tree-optimization/86506 * hwint.h (ceil_log2): Resync with hwint.c implementation. From-SVN: r263064 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c635f776e34..33f5e9f5225 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-07-30 Richard Sandiford + + PR tree-optimization/86506 + * hwint.h (ceil_log2): Resync with hwint.c implementation. + 2018-07-30 Ilya Leoshkevich PR target/86547 diff --git a/gcc/hwint.h b/gcc/hwint.h index 5054d8e3883..8068cad1229 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -242,7 +242,7 @@ floor_log2 (unsigned HOST_WIDE_INT x) static inline int ceil_log2 (unsigned HOST_WIDE_INT x) { - return floor_log2 (x - 1) + 1; + return x == 0 ? 0 : floor_log2 (x - 1) + 1; } static inline int