From afe56ce5d92a348e61bd23f0ed21666c49436c6c Mon Sep 17 00:00:00 2001 From: rsandifo Date: Mon, 30 Jul 2018 11:23:26 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263064 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/hwint.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- 2.11.4.GIT