On 2016-05-05 06:07 AM, Amaury Pouly wrote:


    The removal of #ifdef CLZ_HWI and #ifdef CTZ_HWI code is not needed
    for successful building. That changes floor_log2() and exact_log2()
    from code based on one of the __builtin_clz functions to alternative
    code. I'm left wondering what is the reason for that change.

    My old compiler, a new one with this patch, and a new one without
    the #ifdef code removal all produce the exact same ipodvideo
    rockbox.bin.

The reason of the change is because the newer GCC compile in C11 mode by
default (instead of C89), which has slightly stricter rules on function
redefinition. This patches only makes sure the code compiles in C11, but
otherwise the compiler is exactly the same. You can find more
information about this patch here:
https://gcc.gnu.org/ml/gcc-patches/2009-06/msg01249.html

I understand now. The removal of #ifdef CLZ_HWI and #ifdef CTZ_HWI code simply removes code which will never be compiled due to conditionals. Both floor_log2() and exact_log2() used to be inside an "#if GCC_VERSION < 3004 || !defined (__cplusplus)" block. After the patch it becomes just a #if GCC_VERSION < 3004 block. In toplev.h, CLZ_HWI and CTZ_HWI are only #defined if GCC_VERSION >= 3004.

This looks good and the gcc-patches message says it got committed there also. The patch should definitely be used.

(Resending this to rockbox-dev separately because I forgot to use reply to all the first time.)

Reply via email to