This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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  <>

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

--- 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))
   /* If there were any real insns between note we processed last time


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]