[llvm-commits] Please review: fix conflict between AddressSanitizer and load widening (GVN)

Duncan Sands baldrick at free.fr
Mon Feb 6 12:36:10 PST 2012

Hi Kostya,

+    if (LI->getParent()->getParent()->hasFnAttr(Attribute::AddressSafety) &&
+        LIOffs+NewLoadByteSize > MemLocEnd) {

How about switching the order of the conditions so that the cheap test
(LIOffs+NewLoadByteSize > MemLocEnd) is done first.  That way the more
expensive test is only done if the cheap test passes, but not if it fails.

+      // We will be reading past the location accessed by the original program.
+      // While this is safe in a regular build, Address Safety analysys tools
+      // may start reporting false warnings. So, do't do widening.

do't -> don't

Ciao, Duncan.

More information about the llvm-commits mailing list