🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1774

bug in m68k gcc 1.29

#1774
From: Tom Quinn
Date: Tue, 11 Oct 1988 15:04
158 lines
5423 bytes
The following code causes gcc to get a fatal error if compiled with
the "-O" option.  This is gcc version 1.29 with or without the posted
fix from RMS on a Sun3/50 running SunOS 3.5.

Tom Quinn                 Canadian Institute for Theoretical Astrophysics
trq@moose.cita.toronto.edu
SOON TO BE trq@moose.cita.utoronto.ca
UUCP   - decvax!utgpu!moose!trq
BITNET - quinn@utorphys.bitnet
ARPA   - trq%moose.cita.toronto.edu@relay.cs.net

The compile:
gcc -g -v -O -c mibstore.c
gcc version 1.29
 /usr/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 mibstore.c /tmp/cca01173.cpp
GNU CPP version 1.29
 /usr/local/lib/gcc-cc1 /tmp/cca01173.cpp -quiet -dumpbase mibstore.c -g -O -version -o /tmp/cca01173.s
GNU C version 1.29 (68k, MIT syntax) compiled by GNU C version 1.29.
gcc: Program cc1 got fatal signal 6.

The code:
------------------------------------------------------------------------
typedef short          INT16;
typedef unsigned short CARD16;
typedef struct _xRectangle {
    INT16 x  , y  ;
    CARD16  width  , height  ;
} xRectangle;
typedef unsigned char *pointer;
typedef int Bool;
typedef unsigned long ATOM;
typedef struct _DDXPoint *DDXPointPtr;
typedef struct _Box *BoxPtr;
typedef struct _Region *RegionPtr;
typedef struct _DDXPoint {
    short x, y;
} DDXPointRec;
typedef struct _Box {
    short x1, y1, x2, y2;
} BoxRec;
typedef struct _Region {
    short	size;
    short 	numRects;
    BoxPtr	rects;
    BoxRec 	extents;
} RegionRec;
typedef struct _Screen *ScreenPtr;
typedef struct _DrawInfo *DrawablePtr;	
typedef struct _GC    *GCPtr;
typedef struct _Screen {
    ATOM id;
    short		width, height;
    RegionPtr (* RegionCreate)(); 	 
    void (* RegionCopy)();		 
    int (* Intersect)();		 
    int (* Inverse)();			 
    void (* RegionReset)();		 
    void (* TranslateRegion)();		 
} ScreenRec;
typedef struct _GC{
    ScreenPtr	pScreen;		
    pointer 	devBackingStore;    	 
    int         depth;    
    unsigned long        serialNumber;
    int		alu;
    unsigned long	planemask;
    int		lineWidth;          
    int		arcMode;
    DDXPointRec	patOrg;			 
    int		subWindowMode;
    Bool	graphicsExposures;
    DDXPointRec	clipOrg;
    pointer	clientClip;
    int		clientClipType;		 
    int		dashOffset;
    int		numInDashList;		 
    unsigned long	stateChanges;	 
    void (* ChangeClip) ();
} GC;
typedef struct _Window *WindowPtr;
typedef struct _DrawInfo {
    short	type;
    unsigned long        serialNumber;
} DrawableRec;
typedef struct _Window {
	DrawableRec drawable;		 
	RegionPtr clipList;                
	xRectangle clientWinSize;        
	DDXPointRec  absCorner;
	pointer devBackingStore;		 
} WindowRec;
typedef struct {
    unsigned long serialNumber;	     
} MIBackingStoreRec, *MIBackingStorePtr;
extern void miValidateBackingStore();
typedef struct {
    GCPtr   	  pBackingGC;	     
    RegionPtr	  pTransClientClip;  
} MIBSGCPrivRec, *MIBSGCPrivPtr;
void
miValidateBackingStore(pWin, pGC, procChanges)
    WindowPtr 	  pWin;
    GCPtr   	  pGC;
    int	    	  procChanges;	 
{
    GCPtr   	  	pBackingGC;
    MIBackingStorePtr	pBackingStore;
    MIBSGCPrivPtr 	pPriv;
    int	    	  	stateChanges;
    register int  	index, mask;
    pBackingStore = (MIBackingStorePtr)pWin->devBackingStore;
    pPriv = (MIBSGCPrivPtr)pGC->devBackingStore;
    if ((pWin->drawable.serialNumber != pBackingStore->serialNumber) ||
	(stateChanges&(	(1L<<17) |	(1L<<18) |	(1L<<19) )))
    {
	RegionPtr tempRgn;
	BoxRec	  winBounds;
	pBackingStore->serialNumber = pWin->drawable.serialNumber;
	if (pGC->clientClipType == 		0 )
	{
	    BoxRec	bounds;
	    bounds.x1 = bounds.y1 = 0;
	    bounds.x2 = pWin->clientWinSize.width;
	    bounds.y2 = pWin->clientWinSize.height;
	    (*pGC->pScreen->RegionReset) (pPriv->pTransClientClip,
					  &bounds);
	}
	else if (stateChanges & (	(1L<<17) |	(1L<<18) |	(1L<<19) ))
	{
	    if (pGC->clientClipType != 	2 ) {
		FatalError("miValidateBackingStore: client clip not a region");
	    }
	    (*pGC->pScreen->RegionCopy) (pPriv->pTransClientClip,
					 pGC->clientClip);
	    if (stateChanges & (	(1L<<17) |	(1L<<18) ))
	    {
		(*pGC->pScreen->TranslateRegion) (pPriv->pTransClientClip,
						  pGC->clipOrg.x,
						  pGC->clipOrg.y);
	    }
	}
	tempRgn = (*pGC->pScreen->RegionCreate) (           0 , 1);
	winBounds.x1 = pWin->absCorner.x;
	winBounds.x2 = pWin->absCorner.x + pWin->clientWinSize.width;
	winBounds.y1 = pWin->absCorner.y;
	winBounds.y2 = pWin->absCorner.y + pWin->clientWinSize.height;
	(*pGC->pScreen->Inverse) (tempRgn,
				  pWin->clipList,
				  &winBounds);
	(*pGC->pScreen->TranslateRegion) (tempRgn,
					  -pWin->absCorner.x,
					  -pWin->absCorner.y);
	(*pGC->pScreen->Intersect) (tempRgn,
				    tempRgn,
				    pPriv->pTransClientClip);
	(*pBackingGC->ChangeClip) (pBackingGC, 	2 , tempRgn, 0);
    }
}
Technical Details
Message-ID: <8810111504.AA14470@moose.cita.toronto.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!moose.cita.toronto.edu!trq

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!moose.cita.toronto.edu!trq
From: trq@moose.cita.toronto.edu (Tom Quinn)
Newsgroups: gnu.gcc.bug
Subject: bug in m68k gcc 1.29
Message-ID: <8810111504.AA14470@moose.cita.toronto.edu>
Date: 11 Oct 88 15:04:23 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 158