diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-12-11 11:41:44 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-12-11 11:41:44 +0100 |
commit | c699deeb3ea44bbc646dc0ec3186160cd126386b (patch) | |
tree | fcc38e0c1bdfc18de6a84d5bc67899fcd21da610 /gcc | |
parent | 68a9738af04f4c9fdf37aa48cf16b535eef16c46 (diff) | |
download | gcc-c699deeb3ea44bbc646dc0ec3186160cd126386b.zip gcc-c699deeb3ea44bbc646dc0ec3186160cd126386b.tar.gz gcc-c699deeb3ea44bbc646dc0ec3186160cd126386b.tar.bz2 |
re PR middle-end/43631 (var-tracking inserts notes with non-NULL BLOCK_FOR_INSN in between basic blocks)
PR middle-end/43631
PR bootstrap/55615
* var-tracking.c (emit_note_insn_var_location): If insn is followed
by BARRIER, put note after the BARRIER.
(next_non_note_insn_var_location): Skip over BARRIERs.
(emit_notes_in_bb): If call is followed by BARRIER, put note after
the BARRIER.
* g++.dg/other/pr43631.C: New test.
From-SVN: r194392
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/pr43631.C | 15 | ||||
-rw-r--r-- | gcc/var-tracking.c | 20 |
4 files changed, 43 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4f49f0..282e55f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2012-12-11 Jakub Jelinek <jakub@redhat.com> + PR middle-end/43631 + PR bootstrap/55615 + * var-tracking.c (emit_note_insn_var_location): If insn is followed + by BARRIER, put note after the BARRIER. + (next_non_note_insn_var_location): Skip over BARRIERs. + (emit_notes_in_bb): If call is followed by BARRIER, put note after + the BARRIER. + * sanitizer.def: Add comment about importance of ordering of BUILT_IN_ASAN_REPORT* builtins. * cfgcleanup.c (old_insns_match_p): Don't cross-jump __asan_report_* diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3e81e76..fff359b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-12-11 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/43631 + PR bootstrap/55615 + * g++.dg/other/pr43631.C: New test. + 2012-12-11 Richard Biener <rguenther@suse.de> PR tree-optimization/55079 diff --git a/gcc/testsuite/g++.dg/other/pr43631.C b/gcc/testsuite/g++.dg/other/pr43631.C new file mode 100644 index 0000000..eb4f578 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr43631.C @@ -0,0 +1,15 @@ +// PR middle-end/43631 +// { dg-do compile } +// { dg-options "-g -O2" } +// { dg-additional-options "-mtune=atom" { target i?86-*-* x86_64-*-* } } + +typedef void (*T) (); +struct S { T t; }; +void bar (T) __attribute__ ((__noreturn__)); +S *p; + +void +foo () +{ + try { bar (p->t); } catch (...) { throw 1; } +} diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index c35471c4..98ef1d4 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -8538,7 +8538,10 @@ emit_note_insn_var_location (void **varp, void *data) if (where != EMIT_NOTE_BEFORE_INSN) { - note = emit_note_after (NOTE_INSN_VAR_LOCATION, insn); + rtx after = insn; + while (NEXT_INSN (after) && BARRIER_P (NEXT_INSN (after))) + after = NEXT_INSN (after); + note = emit_note_after (NOTE_INSN_VAR_LOCATION, after); if (where == EMIT_NOTE_AFTER_CALL_INSN) NOTE_DURING_CALL_P (note) = true; } @@ -8892,9 +8895,11 @@ next_non_note_insn_var_location (rtx insn) while (insn) { insn = NEXT_INSN (insn); - if (insn == 0 - || !NOTE_P (insn) - || NOTE_KIND (insn) != NOTE_INSN_VAR_LOCATION) + if (insn == 0) + break; + if (BARRIER_P (insn)) + continue; + if (!NOTE_P (insn) || NOTE_KIND (insn) != NOTE_INSN_VAR_LOCATION) break; } @@ -8923,7 +8928,7 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set) dataflow_set_clear_at_call (set); emit_notes_for_changes (insn, EMIT_NOTE_AFTER_CALL_INSN, set->vars); { - rtx arguments = mo->u.loc, *p = &arguments, note; + rtx arguments = mo->u.loc, *p = &arguments, note, after; while (*p) { XEXP (XEXP (*p, 0), 1) @@ -8947,7 +8952,10 @@ emit_notes_in_bb (basic_block bb, dataflow_set *set) else *p = XEXP (*p, 1); } - note = emit_note_after (NOTE_INSN_CALL_ARG_LOCATION, insn); + after = insn; + while (NEXT_INSN (after) && BARRIER_P (NEXT_INSN (after))) + after = NEXT_INSN (after); + note = emit_note_after (NOTE_INSN_CALL_ARG_LOCATION, after); NOTE_VAR_LOCATION (note) = arguments; /* If insn is BB_END of some bb, make sure the note doesn't have BLOCK_FOR_INSN set. The notes don't |