This is an archive of the discontinued LLVM Phabricator instance.

Fix PR33732
ClosedPublic

Authored by glider on Jul 10 2017, 11:49 AM.

Details

Reviewers
kcc
eugenis
Summary

Coverage hooks that take less-than-64-bit-integers as parameters need the zeroext parameter attribute (http://llvm.org/docs/LangRef.html#paramattrs) to make sure they are properly extended by the x86_64 ABI.

Diff Detail

Event Timeline

glider created this revision.Jul 10 2017, 11:49 AM
kcc edited edge metadata.Jul 10 2017, 11:50 AM

test?

Please go over other sanitizer APIs and check if we have any other i8/16/32 args. dfsan?

lib/Transforms/Instrumentation/SanitizerCoverage.cpp
255

I guess this should be arch-dependent because this is part of ABI. However, probably we don't care. But a comment would not harm, this is tricky.

glider updated this revision to Diff 105990.Jul 11 2017, 3:29 AM

Added the tests.

Regarding other instrumentation passes, I'd rather fix them in separate CLs.

Reid Kleckner mentioned on llvm-dev that the extension should be performed for i8 and i16, but not i32.
I couldn't find any decent info about zero extension in the x86_64 ABI documentation, but I think having it for i32 won't hurt anyway.
WDYT?

kcc accepted this revision.Jul 17 2017, 10:55 AM

LGTM

This revision is now accepted and ready to land.Jul 17 2017, 10:55 AM
eugenis edited edge metadata.Jul 26 2017, 3:05 PM

Can this revision be closed now?

glider closed this revision.Nov 22 2017, 1:38 AM

Landed in r308296.