[c++] parameter passing bug

Jason Merrill jason@redhat.com
Fri Dec 15 00:51:00 GMT 2000


This is just a debugging issue; the debugger is stopping before the end of
the prologue, because everything is on the same line.  If you give the
opening brace of is() its own line (or just stepi), you will see the right
value for __c.

In the past, we've emitted a second line note after the prologue, even if
it's for the same line number, so that gdb can tell where the real
beginning of the function is; I don't know why we stopped.

Fixed this requires changes to both gcc and gas.  gas folks, is this OK?
Would you rather I remove the optimization code, rather than simply turning
it off?

2000-12-14  Jason Merrill  <jason@redhat.com>

	* jump.c (jump_optimize_1): Don't delete the line note after the
	prologue even if it seems redundant.

*** jump.c.~1~	Wed Nov 29 14:01:06 2000
--- jump.c	Thu Dec 14 16:53:53 2000
*************** jump_optimize_1 (f, cross_jump, noop_mov
*** 723,740 ****
      rtx last_note = 0;
  
      for (insn = f; insn; insn = NEXT_INSN (insn))
!       if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) >= 0)
  	{
! 	  /* Delete this note if it is identical to previous note.  */
! 	  if (last_note
! 	      && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
! 	      && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
  	    {
! 	      delete_insn (insn);
! 	      continue;
! 	    }
  
! 	  last_note = insn;
  	}
    }
  
--- 723,747 ----
      rtx last_note = 0;
  
      for (insn = f; insn; insn = NEXT_INSN (insn))
!       if (GET_CODE (insn) == NOTE)
  	{
! 	  if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
! 	    /* Any previous line note was for the prologue; gdb wants a new
! 	       note after the prologue even if it is for the same line.  */
! 	    last_note = NULL_RTX;
! 	  else if (NOTE_LINE_NUMBER (insn) >= 0)
  	    {
! 	      /* Delete this note if it is identical to previous note.  */
! 	      if (last_note
! 		  && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
! 		  && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
! 		{
! 		  delete_insn (insn);
! 		  continue;
! 		}
  
! 	      last_note = insn;
! 	    }
  	}
    }
  
2000-12-14  Jason Merrill  <jason@redhat.com>

	* dwarf2dbg.c (process_entries): Don't optimize redundant line notes.

*** gas/dwarf2dbg.c.~1~	Tue Dec  5 13:56:01 2000
--- gas/dwarf2dbg.c	Thu Dec 14 18:58:25 2000
*************** process_entries (seg, e)
*** 861,867 ****
  	  changed = 1;
  	}
  
!       if (line != e->loc.line || changed)
  	{
  	  int line_delta = e->loc.line - line;
  	  if (frag == NULL)
--- 861,871 ----
  	  changed = 1;
  	}
  
!       /* Don't try to optimize away redundant entries; gdb wants two
! 	 entries for a function where the code starts on the same line as
! 	 the {, and there's no way to identify that case here.  Trust gcc
! 	 to optimize appropriately.  */
!       if (1 /* line != e->loc.line || changed */)
  	{
  	  int line_delta = e->loc.line - line;
  	  if (frag == NULL)


More information about the Binutils mailing list