This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/66190] [5/6 Regression] ICE: tree code âcall_exprâ is not supported in LTO streams with -fsanitize=null
- 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: Mon, 18 May 2015 16:55:37 +0000
- Subject: [Bug sanitizer/66190] [5/6 Regression] ICE: tree code âcall_exprâ is not supported in LTO streams with -fsanitize=null
- Auto-submitted: auto-generated
- References: <bug-66190-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66190
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
So maybe the following? Not sure how well it plays with weak vars/fns
though...
--- a/gcc/c-family/c-ubsan.c
+++ b/gcc/c-family/c-ubsan.c
@@ -433,8 +433,9 @@ 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)
+ && !TREE_STATIC (TREE_OPERAND (op, 0)))
instrument = true;
flag_delete_null_pointer_checks
= save_flag_delete_null_pointer_checks;