毕昇3.1.0 编译Bug #3
收藏回复举报
毕昇3.1.0 编译Bug #3
t('forum.solved') 已解决
发表于2023-11-29 18:45:10
0 查看

毕昇3.1.0的opt在通过“-passes=correlated-propagation,dce,flattencfg”编译特定代码时会生成错误代码

Command Lines:

clang -O3 -mllvm -disable-llvm-optzns -c -emit-llvm a.c -o a.bc
opt -passes=correlated-propagation,dce,flattencfg a.bc -o a.opt.bc
clang a.opt.bc -o a.out
 ./a.out
Floating point exception (core dumped)

Source Code:

int a;
void b() {
  int c;
  unsigned int d = 6;
  c = 3 % (((a || 0) < 0) - d || 0);
}
int main() { b(); }

我要发帖子