Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant::signExtend crash LLVM-13 on M1 Monterey #22

Open
ganler opened this issue Apr 21, 2022 · 0 comments
Open

Constant::signExtend crash LLVM-13 on M1 Monterey #22

ganler opened this issue Apr 21, 2022 · 0 comments

Comments

@ganler
Copy link

ganler commented Apr 21, 2022

I am developing a new pass using LLVM-13 from Homebrew and I got a strange bug that whenever I call Constant::signExtend the pass crashes with opt invoked. However, when I use Linux x64 (also LLVM-14) it is not an issue. I did not find any recent commit on LLVM's Constant::signExtend so I guess it is either related to Homebrew or M1?

To reproduce this bug:

git clone git@github.com:ganler/mini-kint.git
mkdir -p mini-kint/build
cd mini-kint/build
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
cmake .. -DLLVM_DIR=/opt/homebrew/opt/llvm/lib/cmake/llvm -DCMAKE_CXX_COMPILER=$(which clang++) -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Debug

make -j8

Create a file a.c

#include <stdint.h>

size_t __mkint_ann_malloc_array_nc(uint8_t n, uint8_t size) { return n * size; }
clang -O0 -Xclang -disable-O0-optnone -emit-llvm -S a.c
opt -load-pass-plugin=mkint/MiniKintPass.dylib -passes=mkint-pass -S a.ll
# crash

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant