diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/hwint.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c635f77..33f5e9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> PR target/86547 diff --git a/gcc/hwint.h b/gcc/hwint.h index 5054d8e..8068cad 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 |