Commit 1dcadcf0 by Richard Sandiford Committed by Richard Sandiford

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  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86506
	* hwint.h (ceil_log2): Resync with hwint.c implementation.

From-SVN: r263064
parent dc843a85
2018-07-30 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/86506
* hwint.h (ceil_log2): Resync with hwint.c implementation.
2018-07-30 Ilya Leoshkevich <iii@linux.ibm.com> 2018-07-30 Ilya Leoshkevich <iii@linux.ibm.com>
PR target/86547 PR target/86547
......
...@@ -242,7 +242,7 @@ floor_log2 (unsigned HOST_WIDE_INT x) ...@@ -242,7 +242,7 @@ floor_log2 (unsigned HOST_WIDE_INT x)
static inline int static inline int
ceil_log2 (unsigned HOST_WIDE_INT x) 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 static inline int
......
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