[cfe-dev] [ubsan] Add -fsanitize-warn-once, only emit runtime error once per check

Will Dietz willdtz at gmail.com
Thu Dec 13 09:33:59 PST 2012


This flag causes clang to emit a byte for each check that is used by the
runtime to track whether we've already printed an error for that check.

 Often failed checks are triggered many times dynamically, but a user
 is only interested in which checks failed (with example dynamic values
 to aid in debugging).  This flag lets the user make such runs much
 more efficient and generate more manageable output.
----------------

Requires corresponding patch to compiler-rt, both are attached.
Staging as cc1 option, since for now recovery is a cc1 flag as well.
If this goes in, would like to promote it along the recovery to driver
flags.

Anyway, I was concerned this would cause problems performance-wise
(another argument, another register), but impact on SPEC CINT2006 is a
tad noisy but overall seems like it has neglible impact.  Usual chart
attached.

Thoughts/review appreciated, thanks!

~Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ubsan-Add-fsanitize-warn-once-only-emit-runtime-erro.patch
Type: application/octet-stream
Size: 17270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121213/06b856e1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ubsan-Support-fsanitize-warn-once-only-warn-first-ti.patch
Type: application/octet-stream
Size: 16945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121213/06b856e1/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slows.pdf
Type: application/pdf
Size: 5567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121213/06b856e1/attachment.pdf>


More information about the cfe-dev mailing list