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