This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/70342] g++ -fsanitize=undefined never finishes compiling (>24h) in qtxmlpatterns test suite
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 27 Apr 2016 16:00:19 +0000
- Subject: [Bug sanitizer/70342] g++ -fsanitize=undefined never finishes compiling (>24h) in qtxmlpatterns test suite
- Auto-submitted: auto-generated
- References: <bug-70342-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70342
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
So it seems this fixes this problem:
diff --git a/gcc/c-family/c-ubsan.c b/gcc/c-family/c-ubsan.c
index 4022bdf..b829c04 100644
--- a/gcc/c-family/c-ubsan.c
+++ b/gcc/c-family/c-ubsan.c
@@ -395,8 +395,11 @@ ubsan_maybe_instrument_reference_or_call (location_t loc,
tree op, tree ptype,
int save_flag_delete_null_pointer_checks
= flag_delete_null_pointer_checks;
flag_delete_null_pointer_checks = 1;
- if (!tree_single_nonzero_warnv_p (op, &strict_overflow_p)
- || strict_overflow_p)
+ if ((!tree_single_nonzero_warnv_p (op, &strict_overflow_p)
+ || strict_overflow_p)
+ /* Instrumenting &TARGET_EXPR <...> is a waste and can result
+ in compile-time hog; see PR70342. */
+ && TREE_CODE (TREE_OPERAND (op, 0)) != TARGET_EXPR)
instrument = true;
flag_delete_null_pointer_checks
= save_flag_delete_null_pointer_checks;