[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: glib 1.1.12, gtk1.1.12 for debian/ppc



On Fri, Jan 15, 1999 at 11:23:40PM +0200, Konstantinos Margaritis wrote:
> This is indeed funny, because I got myself down to just that... bug
> tracking. Well, I may say I have been lucky, because I managed to pinpoint
> the offending function. Actually there was no bug in testglib.c itself,
> rather to a system function, one which I have heard a lot of, and has
> pissed me quite a lot personally when working on some Convex systems...
> 
> alloca
> 
> Actually testglib #defined g_alloca as alloca and used that instead, still
> the problem is alloca itself, not the definition. The code that is causing
> all the trouble is the only occurence of alloca in testglib.c, which
> follows -the excerpt not the file!

I suspect that alloca itself is not at fault.  Anyway....

> line 913:
> #ifdef G_HAVE_ALLOCA
>   g_print ("checking alloca()-based allocation routines...");
> 
>   string = g_alloca(80);          <-------- offending line!
>   g_assert(string != NULL);
>   for (i = 0; i < 80; i++)
>     string[i] = 'x';
>   string[79] = 0;
>   g_assert(strlen(string) == 79);
> 
> the compiler command is 
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I. -DG_LOG_DOMAIN=g_log_domain_glib  -O3 \
> -Wall -c testglib.c
> 
> and it produces the output
> 
> testglib.c: In function `main':
> testglib.c:302: warning: unused variable `gti'
> testglib.c:291: warning: `tmp_string' might be used uninitialized in this
> function
> testglib.c:966: internal error--unrecognizable insn:
> (insn 11027 11024 11023 (set (reg:DI 18 r18)
>         (mem:DI (plus:SI (reg:SI 18 r18)
>                 (const_int 65536)))) -1 (insn_list 8761 (insn_list 8784
> (insn_list 8800 (insn_list 8807 (insn_list 8823 (insn_list 8835 (insn_list
> 8830 (insn_list 8843 (insn_list 8855 (insn_list 8850 (insn_list 8870
> (insn_list 11024 (insn_list:REG_DEP_OUTPUT 11016 (insn_list:REG_DEP_ANTI
> 11019 (insn_list:REG_DEP_ANTI 11022 (nil))))))))))))))))
>     (nil))
> ../../gcc/toplev.c:1378: Internal compiler error in function fatal_insn

Notice on the third line of the insn dump, the (const_int 65536).  I am
fairly sure that that is the invalid part.

> which keeps appearing still if I replace -O3 with -O2, but disappears with
> -O.

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.


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.



Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/


Reply to: