OSDN Git Service

* Makefile.in (install-info): Simplify.
[pf3gnuchains/gcc-fork.git] / gcc / cfglayout.c
index 7172eaa..7c7600a 100644 (file)
@@ -415,6 +415,18 @@ insn_scope (rtx insn)
   int min = 0;
   int loc = INSN_LOCATOR (insn);
 
+  /* When block_locators_locs was initialized, the pro- and epilogue
+     insns didn't exist yet and can therefore not be found this way.
+     But we know that they belong to the outer most block of the
+     current function.
+     Without this test, the prologue would be put inside the block of
+     the first valid instruction in the function and when that first
+     insn is part of an inlined function then the low_pc of that
+     inlined function is messed up.  Likewise for the epilogue and
+     the last valid instruction.  */
+  if (loc == prologue_locator || loc == epilogue_locator)
+    return DECL_INITIAL (cfun->decl);
+
   if (!max || !loc)
     return NULL;
   while (1)
@@ -435,13 +447,12 @@ insn_scope (rtx insn)
    return VARRAY_TREE (block_locators_blocks, min);
 }
 
-/* Return line number of the statement that produced this insn.  */
+/* Return line number of the statement specified by the locator.  */
 int
-insn_line (rtx insn)
+locator_line (int loc)
 {
   int max = VARRAY_ACTIVE_SIZE (line_locators_locs);
   int min = 0;
-  int loc = INSN_LOCATOR (insn);
 
   if (!max || !loc)
     return 0;
@@ -463,13 +474,19 @@ insn_line (rtx insn)
    return VARRAY_INT (line_locators_lines, min);
 }
 
-/* Return source file of the statement that produced this insn.  */
+/* Return line number of the statement that produced this insn.  */
+int
+insn_line (rtx insn)
+{
+  return locator_line (INSN_LOCATOR (insn));
+}
+
+/* Return source file of the statement specified by LOC.  */
 const char *
-insn_file (rtx insn)
+locator_file (int loc)
 {
   int max = VARRAY_ACTIVE_SIZE (file_locators_locs);
   int min = 0;
-  int loc = INSN_LOCATOR (insn);
 
   if (!max || !loc)
     return NULL;
@@ -491,6 +508,13 @@ insn_file (rtx insn)
    return VARRAY_CHAR_PTR (file_locators_files, min);
 }
 
+/* Return source file of the statement that produced this insn.  */
+const char *
+insn_file (rtx insn)
+{
+  return locator_file (INSN_LOCATOR (insn));
+}
+
 /* Rebuild all the NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes based
    on the scope tree and the newly reordered instructions.  */
 
@@ -783,7 +807,7 @@ fixup_reorder_chain (void)
   prev_bb->next_bb = EXIT_BLOCK_PTR;
   EXIT_BLOCK_PTR->prev_bb = prev_bb;
 
-  /* Anoying special case - jump around dead jumptables left in the code.  */
+  /* Annoying special case - jump around dead jumptables left in the code.  */
   FOR_EACH_BB (bb)
     {
       edge e;