[gnu.g++.bug] program kills g++ 1.27 on sparc

schmidt%blanche.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") (11/30/88)

Hi,

   The following short program causes a segmentation violation on the
sun 4 when compiled with the -O option with g++ 1.27.

----------------------------------------
/* kills sparc with -O */
typedef struct _XRegion *Region; 

typedef struct {
    short x, y;
    unsigned short width, height;
} XRectangle;

static Region HighlightRegion()
{
    static Region outerRegion = 0, innerRegion, emptyRegion;
    XRectangle rect;

    rect.x = rect.y = 0;
    XUnionRectWithRegion( &rect, emptyRegion, innerRegion );
    XSubtractRegion( outerRegion, innerRegion, outerRegion );
    return outerRegion;
}
----------------------------------------

Here is the diagnostic:

----------------------------------------
g++ version 1.27.0
 echo use .cc filename extension!
use .cc filename extension!
 /usr/public/lib/g++/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dsparc
-Dsun -Dunix -D__OPTIMIZE__ -+ crash-bug.1.31.c /tmp/cca05565.cpp

GNU CPP version 1.27.0
 /usr/public/lib/g++/gcc-c++ /tmp/cca05565.cpp -quiet -dumpbase
crash-bug.1.31.c -O -version -o /tmp/cca05565.s

crash-bug.1.31.c:15: Segmentation violation
/usr/public/g++: Program c++ got fatal signal 11.

----------------------------------------

Doug