🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #878

SIGSEGV from eliminate_frame_pointer\reload1.c

#878
From: Tom Wood
Date: Tue, 16 Jan 1990 20:02
65 lines
2477 bytes
This is potentially a processor specific problem, but as far as I can tell
it isn't.  I have a rather large sample program that when compiled will
generate a SIGSEGV from cc1.  This occurs in GCC 1.35 on the m88100, but
the flaw is also in 1.36.92.  

The loop in eliminate_frame_pointer (in reload1.c) starts off as follows:

  for (insn = first; insn; insn = NEXT_INSN (insn))
    {
      rtx pattern = PATTERN (insn);
      switch (GET_CODE (insn))
	{
	case INSN:

The SIGSEGV occurs when insn is "(barrier A B C)" and it's address is such
that PATTERN(insn) ((char *)insn + 16 on the 88k) is just off the edge
of the data segment.  GET_CODE (insn) is UnKnown, so pattern is never used.
Here's the obvious change for this:

*** reload1.c.orig	Tue Jan 16 14:53:51 1990
--- reload1.c	Tue Jan 16 14:54:55 1990
***************
*** 1088,1097 ****
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      {
!       rtx pattern = PATTERN (insn);
        switch (GET_CODE (insn))
  	{
  	case INSN:
  	  frame_pointer_address_altered = 0;
  	  alter_frame_pointer_addresses (pattern, depth);
  	  /* Rerecognize insn if changed.  */
--- 1088,1098 ----
  
    for (insn = first; insn; insn = NEXT_INSN (insn))
      {
!       rtx pattern;
        switch (GET_CODE (insn))
  	{
  	case INSN:
+ 	  pattern = PATTERN (insn);
  	  frame_pointer_address_altered = 0;
  	  alter_frame_pointer_addresses (pattern, depth);
  	  /* Rerecognize insn if changed.  */
***************
*** 1129,1134 ****
--- 1130,1136 ----
  	  break;
  
  	case JUMP_INSN:
+ 	  pattern = PATTERN (insn);
  	  frame_pointer_address_altered = 0;
  	  alter_frame_pointer_addresses (pattern, depth);
  	  /* Rerecognize insn if changed.  */
***************
*** 1155,1160 ****
--- 1157,1163 ----
  	  break;
  
  	case CALL_INSN:
+ 	  pattern = PATTERN (insn);
  	  frame_pointer_address_altered = 0;
  	  alter_frame_pointer_addresses (pattern, depth);
  	  /* Rerecognize insn if changed.  */
Technical Details
Message-ID: <9001162002.AA13678@gen-rtx.rtp.dg.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!DG-RTP.DG.COM!wood

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!DG-RTP.DG.COM!wood
From: wood@DG-RTP.DG.COM (Tom Wood)
Newsgroups: gnu.gcc.bug
Subject: SIGSEGV from eliminate_frame_pointer\reload1.c
Message-ID: <9001162002.AA13678@gen-rtx.rtp.dg.com>
Date: 16 Jan 90 20:02:32 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: wood@dg-rtp.dg.com
Distribution: gnu
Organization: Data General, RTP, NC
Lines: 65