https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84193
Bug ID: 84193 Summary: Document the limitations of -fcheck-pointer-bounds Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: bruno at clisp dot org Target Milestone: --- The documentation of -fcheck-pointer-bounds in https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/Instrumentation-Options.html says - what the option does, - what are the prerequisites from other tools, - how it can be fine-tuned. However, it does not say what are the limitations. === Quoting the article "Design of Intel MPX" from Intel <https://intel-mpx.github.io/design/>: "At the application level, the MPX-protected program may require manual changes due to troublesome C coding patterns, multithreading issues, or potential problems with other ISA extensions. (In some cases, it is inadvisable to use MPX at all.)" "the protected application will have worse cache locality" "Intel MPX can cause issues when used together with other ISA extensions, e.g., Intel TSX and Intel SGX. Intel MPX may cause transactional aborts in some corner cases when used inside an Intel TSX hardware transaction ..." "our evaluation reveals that narrowing of bounds breaks many programs (see Usability)..." (The entire section "Not supported C idioms" is relevant.) === Quoting Florian Weimer, a glibc co-maintainer <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00015.html>: "-fcheck-pointer-bounds in GCC doesn't really work. The existing implementation is barely a research prototype (for example, most string functions are not protected by it), and I don't think anyone knows how to make it thread-safe." Really, as a user of GCC, I would like to be made aware of these limitations through the GCC documentation, so that I don't waste my time attempting to use a technology that will not work with my application.