🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2278

gcc 1.33 vax gets signal 10 (w/possible fix)

#2278
From: Ken Raeburn
Date: Mon, 13 Feb 1989 14:19
45 lines
1803 bytes
In compiling the file:

    struct format_data
    {
      char format;
      char size;
    };

    decode_format (string_ptr)
	 char **string_ptr;
    {
      struct format_data val;
      register char *p = *string_ptr;

      val.size = *p++;
    }

with optimization enabled, under gcc 1.33 with two patches from RMS, I
get a bus error.  (The file is a very stripped-down function from gdb
3.1.)  The CSE pass dumps core in trying to use REGNO(SUBREG_REG(x))
when x is of the form (SUBREG (MEM)).

The patch I've put in place that seems to fix it is:

*** /tmp/,RCSt1001028   Mon Feb 13 09:01:03 1989
--- cse.c       Mon Feb 13 08:55:38 1989
***************
*** 2392,2397 ****
--- 2392,2398 ----
    /* If integer truncation is being done with SUBREG,
       we can compute the result.  */
    else if (GET_CODE (x) == SUBREG && SUBREG_WORD (x) == 0
+            && GET_CODE (SUBREG_REG (x)) == REG
             && (tem1 = qty_const[reg_qty[REGNO (SUBREG_REG (x))]]) != 0
             /* Make sure it is a known integer.  */
             && GET_CODE (tem1) == CONST_INT

However, according to the documentation, (SUBREG (MEM)) should only be
found between the combiner and reloader passes, and CSE is listed well
before the combiner pass, so either the documentation needs updating
or this fix is insufficient.

-- Ken Raeburn
   MIT Project Athena
Technical Details
Message-ID: <8902131419.AA04016@MULTICS.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn
From: raeburn@ATHENA.MIT.EDU (Ken Raeburn)
Newsgroups: gnu.gcc.bug
Subject: gcc 1.33 vax gets signal 10 (w/possible fix)
Message-ID: <8902131419.AA04016@MULTICS.MIT.EDU>
Date: 13 Feb 89 14:19:57 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 45