diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-12-15 10:37:47 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-12-15 10:37:47 +0100 |
commit | 9ab3864f623b4eb9cc3f4ac161f81e7cc29a9990 (patch) | |
tree | 0c73bed8563c2b824c6146cca4b2624218c21fce /gcc | |
parent | 0675001e9827fe45b6d9994452915e8929651ecd (diff) | |
download | gcc-9ab3864f623b4eb9cc3f4ac161f81e7cc29a9990.zip gcc-9ab3864f623b4eb9cc3f4ac161f81e7cc29a9990.tar.gz gcc-9ab3864f623b4eb9cc3f4ac161f81e7cc29a9990.tar.bz2 |
re PR sanitizer/64265 (r217669 broke tsan)
PR sanitizer/64265
* tsan.c (instrument_func_entry): Insert __tsan_func_entry
call on edge from entry block to single succ instead
of after labels of single succ of entry block.
From-SVN: r218734
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tsan.c | 15 |
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e0ca74..a6beef9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR sanitizer/64265 + * tsan.c (instrument_func_entry): Insert __tsan_func_entry + call on edge from entry block to single succ instead + of after labels of single succ of entry block. + 2014-12-15 Richard Biener <rguenther@suse.de> PR tree-optimization/64284 @@ -652,25 +652,24 @@ instrument_memory_accesses (void) static void instrument_func_entry (void) { - basic_block succ_bb; - gimple_stmt_iterator gsi; tree ret_addr, builtin_decl; gimple g; - - succ_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); - gsi = gsi_after_labels (succ_bb); + gimple_seq seq = NULL; builtin_decl = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS); g = gimple_build_call (builtin_decl, 1, integer_zero_node); ret_addr = make_ssa_name (ptr_type_node); gimple_call_set_lhs (g, ret_addr); gimple_set_location (g, cfun->function_start_locus); - gsi_insert_before (&gsi, g, GSI_SAME_STMT); + gimple_seq_add_stmt_without_update (&seq, g); - builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_ENTRY); + builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_ENTRY); g = gimple_build_call (builtin_decl, 1, ret_addr); gimple_set_location (g, cfun->function_start_locus); - gsi_insert_before (&gsi, g, GSI_SAME_STMT); + gimple_seq_add_stmt_without_update (&seq, g); + + edge e = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)); + gsi_insert_seq_on_edge_immediate (e, seq); } /* Instruments function exits. */ |