[gnu.gcc.bug] gcc 1.36 i386v bug

james@raid.dell.com (James Van Artsdalen) (11/15/89)

config.gcc i386v.  If the following file is compiled by gcc without
optimization, gcc aborts.  If any short in struct a, or any local int
in k(), is deleted, gcc gets a segmentation fault.  If f() or k() are
removed, gcc does not abort or get a fault.
-----
struct a {
  short b;
  short c;
  short d;
  short e;
};

f()
{
     struct { struct a g, h, i; } j;
}

int k()
{
     int l;
     int m;
     int n;
     struct a *o;
     struct { struct a p, q, r; } s;
}
-----
raid:/usr/local/src/gcc-1.36/i386> gdb cc1
GDB 3.3, Copyright (C) 1989 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /usr/local/src/gcc-1.36/i386/cc1...done.
Breakpoint 1 at 0x73160
Type "help" for a list of commands.
(gdb) run -version q.i
Starting program: /usr/local/src/gcc-1.36/i386/cc1 -version q.i
GNU C version 1.36 (80386, ATT syntax) compiled by GNU C version 1.36.
default target switches: -m80387
 f k
Bpt 1, 0x73160 in abort ()
(gdb) bt
#0  0x73160 in abort ()
#1  0x1ec5d in convert_move (to=(rtx) 0x40c5e0, from=(rtx) 0xce, unsignedp=0) (expr.c line 601)
#2  0x2023c in store_expr (exp=(union tree_node *) 0x40c3ac, target=(rtx) 0x40c5e0, suggest_reg=0, 28) (expr.c line 1851)
#3  0x20d40 in expand_expr (exp=(union tree_node *) 0x40c5c4, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 2268)
#4  0x19066 in variable_size ()
#5  0x19e13 in layout_type ()
#6  0xc071 in finish_struct ()
#7  0x46dd in yyparse ()
#8  0x139ba in compile_file (2147482978)
#9  0x1503d in main (Error reading memory address 0x253bd82a: I/O error (5).
(gdb) fr 1
#1  0x1ec5d in convert_move (to=(rtx) 0x40c5e0, from=(rtx) 0xce, unsignedp=0) (expr.c line 601)
601	  abort ();
(gdb) list
596	#endif
597	      abort ();
598	    }
599	
600	  /* Mode combination is not recognized.  */
601	  abort ();
602	}
603	
604	/* Return an rtx for a value that would result
605	   from converting X to mode MODE.
(gdb) p to
$1 = (rtx) 0x40c5e0
(gdb) pr
(reg:L 10)
(gdb) p from
$2 = (rtx) 0xce
(gdb) info locals
to = (rtx) 0x40c5e0
from = (rtx) 0xce
(gdb) fr 2
#2  0x2023c in store_expr (exp=(union tree_node *) 0x40c3ac, target=(rtx) 0x40c5e0, suggest_reg=0, 28) (expr.c line 1851)
1851		    convert_move (target, temp, unsignedp);
(gdb) info locals
unsignedp = 0
temp = (rtx) 0xce
dont_return_target = 0
exp = (union tree_node *) 0x40c3ac
target = (rtx) 0x40c5e0
(gdb) p target
$3 = (rtx) 0x40c5e0
(gdb) pr

(reg:L 10)
(gdb) fr 3
#3  0x20d40 in expand_expr (exp=(union tree_node *) 0x40c5c4, target=(rtx) 0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) (expr.c line 2268)
2268		  store_expr (TREE_OPERAND (exp, 0), reg, 0);
(gdb) info locals
reg = (rtx) 0x40c5e0
op0 = (rtx) 0x40c578
op1 = (rtx) 0x0
temp = (rtx) 0x0
type = (union tree_node *) 0xfffffff4
mode = MAX_MACHINE_MODE
code = SAVE_EXPR
this_optab = (optab) 0x72
negate_1 = 91391
subtarget = (rtx) 0x0
original_target = (rtx) 0x0
ignore = 0
exp = (union tree_node *) 0x40c5c4
(gdb) p reg
$4 = (rtx) 0x40c5e0
(gdb) pr

(reg:L 10)
(gdb) p op0
$5 = (rtx) 0x40c578
(gdb) pr

(L (nil) NOTE_INSN_FUNCTION_BEGswitch format wrong in rtl.print_rtx(). format was: t.

Bpt 1, 0x73160 in abort (4220604, 117638, 116)
Cannot continue previously requested operation.
Unable to restore previously selected frame.
(gdb) 
-- 
James R. Van Artsdalen          james@raid.dell.com       "Live Free or Die"
DCC Corporation       9505 Arboretum Blvd Austin TX 78759       512-338-8789