[PATCH] D156821: [CodeGen] [ubsan] Respect integer overflow handling in abs builtin

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 13:46:05 PDT 2023


MaskRay added a comment.

In D156821#4599471 <https://reviews.llvm.org/D156821#4599471>, @thurston wrote:

> This patch might have broke the buildbots, starting with when it was first built in https://lab.llvm.org/buildbot/#/builders/85/builds/18390
>
>   /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_build_ubsan/include/c++/v1/stdlib.h:114:25: runtime error: negation of -9223372036854775808 cannot be represented in type 'long'; cast to an unsigned type to negate this value to itself
>       #0 0x5586b6dfb9aa in abs /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_build_ubsan/include/c++/v1/stdlib.h:114:10
>       #1 0x5586b6dfb9aa in (anonymous namespace)::GNUELFDumper<llvm::object::ELFType<(llvm::support::endianness)1, true>>::printRelRelaReloc((anonymous namespace)::Relocation<llvm::object::ELFType<(llvm::support::endianness)1, true>> const&, (anonymous namespace)::RelSymbol<llvm::object::ELFType<(llvm::support::endianness)1, true>> const&) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp:3778:21
>
> (which is good insofar as it finds a real bug, but nonetheless is turning the buildbots red)
>
> In the latest buildbots, the error persists (along with an unrelated failure): https://lab.llvm.org/buildbot/#/builders/85/builds/18413
>
> The compiler code is a tad too nuanced for me to fix with confidence (e.g., my first instinct would be to widen the type to int128 but I don't know if that will break compatibility).



  Failed Tests (4):
    LLVM :: CodeGen/RISCV/rvv/fixed-vectors-int.ll
    LLVM :: CodeGen/SystemZ/ctpop-01.ll
    LLVM :: MC/ARM/basic-thumb2-instructions.s
    LLVM :: tools/llvm-readobj/ELF/relocations.test

AFAICT these failures have been fixed and the change can reland after the clang/ test is fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156821/new/

https://reviews.llvm.org/D156821



More information about the cfe-commits mailing list