On Fri, 15 Jan 1999, Daniel Jacobowitz wrote: > I suspect that alloca itself is not at fault. Anyway....
well, maybe you are right, but I found out that it is part of the problem. Removing it removed the bug. And as you can see I have chopped off 99% of the code. I could not remove anything more, because whatever I did fixed the bug. > Notice on the third line of the insn dump, the (const_int 65536). I am > fairly sure that that is the invalid part. You are probably right about that, because it appeared in every failed compile -and not all were exactly the same. > Look up in the info pages the various options for the optimizer. Try > things like -O2 -fno-gcse and -O2 -fno-schedule-insns2. See which one > makes it go away, if any do. Then try -O -fschedule-insns2, etc. Here's the output with -O2 : gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib -O2 \ -Wall -D_REENTRANT -c testglib.c testglib.c: In function `main': testglib.c:9: warning: unused variable `mem' testglib.c:48: warning: `dirname' might be used uninitialized in this function testglib.c:61: internal error--unrecognizable insn: (insn 393 390 389 (set (reg:DI 14 r14) (mem:DI (plus:SI (reg:SI 14 r14) (const_int 65536)))) -1 (insn_list 74 (insn_list 72 (insn_list 390 (insn_list:REG_DEP_ANTI 73 (insn_list:REG_DEP_ANTI 385 (nil)))))) (nil)) ../../gcc/toplev.c:1378: Internal compiler error in function fatal_insn now the same but -O2 -fno-schedule-insns2 gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib -O2 \ -fno-schedule-insns2 -Wall -D_REENTRANT -c testglib.c testglib.c: In function `main': testglib.c:9: warning: unused variable `mem' testglib.c:48: warning: `dirname' might be used uninitialized in this function testglib.c:61: internal error--unrecognizable insn: (insn 393 390 389 (set (reg:DI 14 r14) (mem:DI (plus:SI (reg:SI 14 r14) (const_int 65536)))) -1 (nil) (nil)) ../../gcc/toplev.c:1378: Internal compiler error in function fatal_insn compiling with -O -fschedule-insns2 seemed to solve it. > Try eliminating as much as you can of that file, starting with the > other functions, and recompiling it each time to see if the error goes > away. Get it as small as you can without eliminating the error, > preferably under a hundred lines. how's 62 lines? :) look at the attachment. Well, I must say, that I can not proceed further from here, because I would need to get dirty with assembly code and I am no expert in ppc, assembly (I did some z80 assembly back in spectrum days, but today it's a whole lot different). Konstantinos Margaritis [EMAIL PROTECTED]
#include "glib.h" int main (int argc, char *argv[]) { gchar *string; gchar *mem[10000]; gint i; struct { gchar *filename; gchar *dirname; } dirname_checks[] = { #ifndef NATIVE_WIN32 { "/", "/" }, { "////", "/" }, { ".////", "." }, { ".", "." }, { "..", "." }, { "../", ".." }, { "..////", ".." }, { "", "." }, { "a/b", "a" }, { "a/b/", "a/b" }, { "c///", "c" }, #else { "\\", "\\" }, { ".\\\\\\\\", "." }, { ".", "." }, { "..", "." }, { "..\\", ".." }, { "..\\\\\\\\", ".." }, { "", "." }, { "a\\b", "a" }, { "a\\b\\", "a\\b" }, { "c\\\\\\", "c" }, #endif }; guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]); #ifdef G_HAVE_GINT64 guint64 gu64t1 = G_GINT64_CONSTANT(0x1d636b02300a7aa7U), gu64t2 = G_GINT64_CONSTANT(0xa77a0a30026b631dU); #endif for (i = 0; i < n_dirname_checks; i++) { gchar *dirname; g_free (dirname); } #ifdef G_HAVE_GINT64 g_assert (GUINT64_SWAP_LE_BE (gu64t1) == gu64t2); #endif #ifdef G_HAVE_ALLOCA string = g_alloca(80); #endif return 0; }