re PR debug/12319 (Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine)
authorCarlo Wood <carlo@alinoe.com>
Mon, 29 Sep 2003 23:09:12 +0000 (23:09 +0000)
committerCarlo Wood <carlo@gcc.gnu.org>
Mon, 29 Sep 2003 23:09:12 +0000 (23:09 +0000)
PR debug/12319
* cfglayout.c (insn_scope):  Use prologue_locator and
epilogue_locator; return the outer function scope for
pro- and epilogue insns.

From-SVN: r71926

gcc/ChangeLog
gcc/cfglayout.c

index a9fdc0e083fe12c225947b41c639cddddcf020d9..c2f690187e832f32aaf18f510489ace588fce282 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-30  Carlo Wood  <carlo@alinoe.com>
+
+       PR debug/12319
+        * cfglayout.c (insn_scope):  Use prologue_locator and
+       epilogue_locator; return the outer function scope for
+       pro- and epilogue insns.
+
 2003-09-29  Zack Weinberg  <zack@codesourcery.com>
 
        * objc/objc-act.c (encode_type): Encode INTEGER_TYPEs and
index 7121a3e5db4b986a451f22a280c72cd7ab293672..f713eb16651facfb5f8d51e9b236d2351b642091 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)