You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Yibo Cai (Jira)" <ji...@apache.org> on 2022/04/27 01:38:00 UTC

[jira] [Updated] (ARROW-15461) [C++] arrow-utility-test fails with clang-12 (TestCopyAndReverseBitmapPreAllocated)

     [ https://issues.apache.org/jira/browse/ARROW-15461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yibo Cai updated ARROW-15461:
-----------------------------
    Issue Type: Improvement  (was: Bug)

> [C++] arrow-utility-test fails with clang-12 (TestCopyAndReverseBitmapPreAllocated)
> -----------------------------------------------------------------------------------
>
>                 Key: ARROW-15461
>                 URL: https://issues.apache.org/jira/browse/ARROW-15461
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Yibo Cai
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 7.0.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Unit test {{BitUtilTests.TestCopyAndReverseBitmapPreAllocated}} failed if release build arrow with clang-12, on both x86 and Arm.
> Per my debug, it's related to {{GetReversedBlock}} function [1], when right shift a uint8 value by 8 bits.
> I think it's a compiler bug. From the test code [2], clang-12 returns 1, which is wrong. clang-11 and clang-13 both return 2, the correct answer. Looks clang-12 over optimized the code, there should be no UB in the code (uint8 is promoted to integer before shift).
> A workaround is to treat shifting 8 bits as a special case. Or we can simply ignore this error if the compiler bug is confirmed (I didn't find clang bug report).
> [1] https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/bitmap_ops.cc#L101
> [2] https://godbolt.org/z/TzYWfcP1E



--
This message was sent by Atlassian Jira
(v8.20.7#820007)