summaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-04 23:04:18 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-04 23:04:18 +0000
commitd85a20139d881d9d1adab64ffc7305cb3ae98e2a (patch)
tree0f4ef35ecb306a63e1426bcc2ec3b362210eccfe /gcc/final.c
parent4d4ec3c86cac3f21e5908f762285a995b69dd4e2 (diff)
parent7d500d30a2205a6e6e6783a4b92cc38d66f3b70b (diff)
downloadgcc-d85a20139d881d9d1adab64ffc7305cb3ae98e2a.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 1f1ac1b8b59..90fcf56a910 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1651,12 +1651,26 @@ reemit_insn_block_notes (void)
rtx insn, note;
insn = get_insns ();
- if (!active_insn_p (insn))
- insn = next_active_insn (insn);
- for (; insn; insn = next_active_insn (insn))
+ for (; insn; insn = NEXT_INSN (insn))
{
tree this_block;
+ /* Prevent lexical blocks from straddling section boundaries. */
+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
+ {
+ for (tree s = cur_block; s != DECL_INITIAL (cfun->decl);
+ s = BLOCK_SUPERCONTEXT (s))
+ {
+ rtx note = emit_note_before (NOTE_INSN_BLOCK_END, insn);
+ NOTE_BLOCK (note) = s;
+ note = emit_note_after (NOTE_INSN_BLOCK_BEG, insn);
+ NOTE_BLOCK (note) = s;
+ }
+ }
+
+ if (!active_insn_p (insn))
+ continue;
+
/* Avoid putting scope notes between jump table and its label. */
if (JUMP_TABLE_DATA_P (insn))
continue;