llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.81k stars 11.91k forks source link

UBSan error in lib/Target/R600/AMDGPUISelLowering.cpp (left shift of negative value) #21356

Closed llvmbot closed 10 years ago

llvmbot commented 10 years ago
Bugzilla Link 20982
Resolution FIXED
Resolved on Sep 18, 2014 10:53
Version trunk
OS Linux
Blocks llvm/llvm-project#21189
Reporter LLVM Bugzilla Contributor
CC @arsenm,@tstellar

Extended Description

The following R600 test fails under UBSan bootstrap of LLVM:

LLVM :: CodeGen/R600/llvm.AMDGPU.bfe.i32.ll

The problem is the left shift of negative value in llvm::SDValue constantFoldBFE in AMDGPUISelLowering.cpp (left shift of negative value is undefined behavior in C).

To reproduce: build LLVM with just-built Clang and -DLLVM_USE_SANITIZER=Undefined CMake option. I'm going to disable this specific test case under UBSan, so that suppression will have to be removed as well.

arsenm commented 10 years ago

Fixed in r218057 by not trying to constant fold this for now