From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 17484 invoked from network); 7 Jun 1998 20:22:43 -0000 Received: from post-10.mail.demon.net (HELO post.mail.demon.net) (194.217.242.39) by mail2.redhat.com with SMTP; 7 Jun 1998 20:22:43 -0000 Received: from treblig.demon.co.uk ([194.222.210.232]) by post.mail.demon.net id aa1026966; 7 Jun 98 20:16 GMT Date: Sun, 7 Jun 1998 21:11:20 +0100 (BST) From: Dave Gilbert X-Sender: gilbertd@tardis.home.dave To: egcs-bugs@cygnus.com cc: rth@cygnus.com, axp-list@redhat.com Subject: EGCS aborts on Alpha (includes test code) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, This is effectivly a repost of a bug I reported earlier, but this case I've managed to chop it down to a couple of dozen lines of code. Everything I try to take out of the code now fixes the problem. Dave /* Breaks using : /home/gilbertd/egcs/bin/gcc -O2 -c -mieee davestest.c -mieee necessary, think -O2 necessary (Originally from povray) Causes: #2 0x20000142128 in abort () at ../sysdeps/generic/abort.c:83 #3 0x1201990f8 in summarize_insn () at ./config/alpha/alpha.c:4078 #4 0x120198dc0 in summarize_insn () at ./config/alpha/alpha.c:3980 #5 0x12019934c in alpha_handle_trap_shadows () at ./config/alpha/alpha.c:4181 #6 0x120199614 in alpha_reorg () at ./config/alpha/alpha.c:4253 #7 0x12003059c in rest_of_compilation () at toplev.c:3575 #8 0x120017184 in finish_function () at c-decl.c:7124 #9 0x12000232c in yyparse () at c-parse.y:348 #10 0x12002e464 in compile_file () at toplev.c:2552 #11 0x120031cd4 in main () at toplev.c:4398 gcc -v: Reading specs from /home/dg/egcs/lib/gcc-lib/alphaev56-unknown-linux-gnu/egcs-2.91.34/specs gcc version egcs-2.91.34 19980530 (gcc2 ss-980502 experimental) System is a 21164a on LX motherboard running Linux 2.1.98 */ void *pov_malloc (int size, char *file, int line, char *msg); void *pov_realloc (void *ptr, int size, char *file, int line, char *msg); int Debug_Info (char *format, ...); typedef struct bt_Struct bt; struct bt_Struct { short Entries; bt **Node; }; static int maxelements; static int sort_and_split(Elements, nElem, first, last) bt **Elements; int *nElem, first, last; { int size, i, best_loc; double *area_right; double best_index, new_index; bt *cd; size = last - first; best_index = area_right[0] * (size - 3.0); best_loc = - 1; if ((size <= 4) || (best_loc < 0)) { cd = (bt *)pov_malloc(sizeof(bt),"", 25, "blob"); cd->Entries = (short)size; cd->Node = (bt **)pov_malloc(size*sizeof(bt *), "", 27, "blob"); for (i = 0; i < size; i++) { cd->Node[i] = Elements[first+i]; } if (*nElem > maxelements) { maxelements = 1.5 * maxelements; Debug_Info("%d\n", maxelements); Elements = (bt **)pov_realloc(Elements, maxelements * sizeof(bt *), "", 34,"bounding"); } Elements[*nElem] = cd; (*nElem)++; return (1); } } -------------------------------------------------------------------- / Dr. David Alan Gilbert | Running Linux on Alpha & ARM \ \ gro.gilbert @ treblig.org | ------- Happy in hex ------- / \____________________________|___ http://www.treblig.demon.co.uk __/