[PATCH] D105838: [GlobalOpt] Fix a miscompile when evaluating struct initializers.

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 12:55:54 PDT 2021


jroelofs created this revision.
jroelofs added reviewers: rob.lougher, evgeny777, aeubanks.
Herald added a subscriber: hiraditya.
jroelofs requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The bug was that evaluateBitcastFromPtr attempts a narrowing to a struct's 0th element of a store that covers other elements. While this is okay on the load side, applying it to stores causes us to miss the writes to the additionally covered elements.

rdar://79503568


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105838

Files:
  llvm/lib/Transforms/Utils/Evaluator.cpp
  llvm/test/Transforms/GlobalOpt/store-struct-element.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105838.358040.patch
Type: text/x-patch
Size: 4747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210712/2eaeda48/attachment.bin>


More information about the llvm-commits mailing list