public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs snapshot crash -- check0.f
@ 1998-04-18  5:12 Craig Burley
  1998-04-21 23:21 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Craig Burley @ 1998-04-18  5:12 UTC (permalink / raw)
  To: egcs

This little program in my test suite crashes the egcs snapshot dated
19980328, the most recent one I've been able to conveniently build
and run g77 from:

check0.f:
--------
      logical l(10)
      integer i(10)
      goto (10,20),l
      goto (10,20),i
 10   stop
 20   end
--------

Compiling with or without optimization doesn't seem to matter.

It seems to be just a matter of expand_*_case and/or friends not
quite coping with an ERROR_MARK or two being passed.

Note that this case doesn't crash egcs 1.0.1, so it's a recently
introduced bug.  If I had a more recent snapshot up and running,
I'd debug it myself, which I'll do later if nobody gets around
to working on this.

        tq vm, (burley)

P.S. Dave Love, could you add this test case to the g77 `compile' set?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: egcs snapshot crash -- check0.f
  1998-04-18  5:12 egcs snapshot crash -- check0.f Craig Burley
@ 1998-04-21 23:21 ` Jim Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 1998-04-21 23:21 UTC (permalink / raw)
  To: Craig Burley; +Cc: egcs

This is a bug in code added recently to warn for unreachable code in
switch statements.  It can fail if there is a syntax error.

I am adding this patch to fix the problem.

1998-04-21  Jim Wilson  <wilson@cygnus.com>

	* stmt.c (check_seenlabel): When search for line number note for
	warning, handle case where there is no such note.

Index: stmt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stmt.c,v
retrieving revision 1.33
diff -p -r1.33 stmt.c
*** stmt.c	1998/04/17 12:32:43	1.33
--- stmt.c	1998/04/22 02:36:49
*************** check_seenlabel ()
*** 3848,3859 ****
  	    {
  	      do
  		insn = PREV_INSN (insn);
! 	      while (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) < 0);
  
! 	      warning_with_file_and_line (NOTE_SOURCE_FILE(insn),
! 					  NOTE_LINE_NUMBER(insn),
! 					  "unreachable code at beginning of %s",
! 					  case_stack->data.case_stmt.printname);
  	      break;
  	    }
  	}
--- 3848,3861 ----
  	    {
  	      do
  		insn = PREV_INSN (insn);
! 	      while (insn && (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) < 0));
  
! 	      /* If insn is zero, then there must have been a syntax error.  */
! 	      if (insn)
! 		warning_with_file_and_line (NOTE_SOURCE_FILE(insn),
! 					    NOTE_LINE_NUMBER(insn),
! 					    "unreachable code at beginning of %s",
! 					    case_stack->data.case_stmt.printname);
  	      break;
  	    }
  	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-04-21 23:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-18  5:12 egcs snapshot crash -- check0.f Craig Burley
1998-04-21 23:21 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).