diff mbox

Don't ignore VAR_LOCATION notes that affect last tail call in the function (PR debug/45103)

Message ID 20100728155152.GA18378@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek July 28, 2010, 3:51 p.m. UTC
Hi!

In dwarf2out_var_location we drop on the floor VAR_LOCATION notes
after last real insn in the function, because there are no instructions
it would affect.  That is wrong for NOTE_DURING_CALL_P notes (which
in this case can exist just in functions ending with a noreturn call),
because NOTE_DURING_CALL_P notes affect also the time spent in the call.
If say some variable in a function doing the noreturn call lives in a call
clobbered register, we thus pretend it is live even during the call (which
is not true, it is certainly live only up to the call insn itself, but once
it enters the other function, it might be already clobbered).

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux.
Ok for trunk?

2010-07-28  Jakub Jelinek  <jakub@redhat.com>

	PR debug/45103
	* dwarf2out.c (dwarf2out_var_location): Always consider
	NOTE_DURING_CALL_P notes, even when not followed by real instructions.


	Jakub

Comments

Jason Merrill July 28, 2010, 4:31 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

--- gcc/dwarf2out.c.jj	2010-07-28 10:36:00.000000000 +0200
+++ gcc/dwarf2out.c	2010-07-28 11:44:24.000000000 +0200
@@ -21278,7 +21278,7 @@  dwarf2out_var_location (rtx loc_note)
   next_real = next_real_insn (loc_note);
   /* If there are no instructions which would be affected by this note,
      don't do anything.  */
-  if (next_real == NULL_RTX)
+  if (next_real == NULL_RTX && !NOTE_DURING_CALL_P (loc_note))
     return;
 
   /* If there were any real insns between note we processed last time