aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfglayout.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-08-04 11:30:31 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-08-04 11:30:31 +0000
commit0a7b0aff70e39247454b3266b18b0778e0ae7021 (patch)
tree89ed5e2c88a93888f442be1a3b80f31631739686 /gcc/cfglayout.c
parent2d46eb552760c81cf5a0ac19fee77485b080c98e (diff)
* cfglayout.c (insn_locators_initialize): Update the current
location before initializing a location. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@85554 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r--gcc/cfglayout.c67
1 files changed, 36 insertions, 31 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index a81ce4c7f8c..b805ae5bda9 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -267,12 +267,38 @@ insn_locators_initialize (void)
for (insn = get_insns (); insn; insn = next)
{
+ int active = 0;
+
next = NEXT_INSN (insn);
- if ((active_insn_p (insn)
- && GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
- || !NEXT_INSN (insn)
+ if (NOTE_P (insn))
+ {
+ switch (NOTE_LINE_NUMBER (insn))
+ {
+ case NOTE_INSN_BLOCK_BEG:
+ case NOTE_INSN_BLOCK_END:
+ abort ();
+
+ default:
+ if (NOTE_LINE_NUMBER (insn) > 0)
+ {
+ expanded_location xloc;
+ NOTE_EXPANDED_LOCATION (xloc, insn);
+ line_number = xloc.line;
+ file_name = xloc.file;
+ }
+ break;
+ }
+ }
+ else
+ active = (active_insn_p (insn)
+ && GET_CODE (PATTERN (insn)) != ADDR_VEC
+ && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
+
+ check_block_change (insn, &block);
+
+ if (active
+ || !next
|| (!prologue_locator && file_name))
{
if (last_block != block)
@@ -296,34 +322,13 @@ insn_locators_initialize (void)
VARRAY_PUSH_CHAR_PTR (file_locators_files, (char *) file_name);
last_file_name = file_name;
}
+ if (!prologue_locator && file_name)
+ prologue_locator = loc;
+ if (!next)
+ epilogue_locator = loc;
+ if (active)
+ INSN_LOCATOR (insn) = loc;
}
- if (!prologue_locator && file_name)
- prologue_locator = loc;
- if (!NEXT_INSN (insn))
- epilogue_locator = loc;
- if (active_insn_p (insn))
- INSN_LOCATOR (insn) = loc;
- else if (NOTE_P (insn))
- {
- switch (NOTE_LINE_NUMBER (insn))
- {
- case NOTE_INSN_BLOCK_BEG:
- case NOTE_INSN_BLOCK_END:
- abort ();
-
- default:
- if (NOTE_LINE_NUMBER (insn) > 0)
- {
- expanded_location xloc;
- NOTE_EXPANDED_LOCATION (xloc, insn);
- line_number = xloc.line;
- file_name = xloc.file;
- }
- break;
- }
- }
-
- check_block_change (insn, &block);
}
/* Tag the blocks with a depth number so that change_scope can find