[PATCH] D146987: [Assignment Tracking] Enable by default

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 21 01:15:23 PDT 2023


mstorsjo added a comment.

I'm also running into issues due to this commit. Unfortunately, the issues don't seem to be entirely deterministic. They can be reproduced with https://martin.st/temp/python-preproc.c:

  $ clang -target i686-w64-mingw32 -c -g -O3 python-preproc.c
  Assertion failed: (!(Elmt.getFragmentOrDefault() == Next.getFragmentOrDefault())), function operator(), file AssignmentTrackingAnalysis.cpp, line 2020.

I'm seeing this on macOS with LLVM built with Xcode's clang. On Linux, built with either GCC or Clang, I don't run into this issue.

When running the seemingly working compiler build on Linux in valgrind, I'm hitting use of uninitialized data:

  ==3054473== Conditional jump or move depends on uninitialised value(s)
  ==3054473==    at 0x4900F0A: llvm::ConstantExpr::getGetElementPtr(llvm::Type*, llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, std::optional<unsigned int>, llvm::Type*) (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x48C865F: foldGEPOfGEP(llvm::GEPOperator*, llvm::Type*, bool, llvm::ArrayRef<llvm::Value*>) (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x48D1285: llvm::ConstantFoldGetElementPtr(llvm::Type*, llvm::Constant*, bool, std::optional<unsigned int>, llvm::ArrayRef<llvm::Value*>) (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x4900CEF: llvm::ConstantExpr::getGetElementPtr(llvm::Type*, llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, std::optional<unsigned int>, llvm::Type*) (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x4025C21: simplifyGEPInst(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, bool, llvm::SimplifyQuery const&, unsigned int) [clone .constprop.0] (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x4036E5F: simplifyInstructionWithOperands(llvm::Instruction*, llvm::ArrayRef<llvm::Value*>, llvm::SimplifyQuery const&, unsigned int) [clone .constprop.0] (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)
  ==3054473==    by 0x4037423: llvm::simplifyInstruction(llvm::Instruction*, llvm::SimplifyQuery const&) (in /home/martin/code/llvm-project-bisect/llvm/build/bin/clang-17)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146987



More information about the cfe-commits mailing list