weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (11/30/88)
The following program (a simplified version of code in the file lib/Xaw/Command.c in X11R3), when compiled with -O, causes GCC 1.31 to crash with a segmentation violation in equiv_constant (running on a Sun-2, Sun OS 4.0). 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 a stack trace of the crashed gcc: % adb /usr/local/lib/gcc-cc1 core core file = core -- program ``gcc-cc1'' SIGSEGV 11: segmentation violation $c _equiv_constant(0x8c6fa) + 86 _fold_rtx() + 17a _cse_insn(0x8c77e) + 26c _cse_basic_block(0x8c4b8,0x0) + 68 _cse_main() + 146 _rest_of_compilation(0x8ef22) + 208 _finish_function() + 68 _yyparse() + 638 _compile_file(0xefffe88) + 604 _main(0x8,0xefffe2c,0xefffe50) + 65a $r d0 0x232238 d1 0x21 __DYNAMIC+0x21 d2 0x0 __DYNAMIC d3 0x8c6fa _end+0x52ba d4 0x1 __DYNAMIC+0x1 d5 0x4c __DYNAMIC+0x4c d6 0x0 __DYNAMIC d7 0x2 __DYNAMIC+0x2 a0 0xeffe02c a1 0xeffd708 a2 0x8c6fa _end+0x52ba a3 0x8c6b2 _end+0x5272 a4 0x0 __DYNAMIC a5 0x0 __DYNAMIC a6 0xeffd450 sp 0xeffd440 pc 0x3a98e _equiv_constant+0x86 ps 0x0 __DYNAMIC 0x0 __DYNAMIC _equiv_constant+0x86: movl a0@(0,d0:l),d0