This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bus error in gengtype


On Thu, Apr 21, 2005 at 09:54:34AM -0700, Richard Henderson wrote:
> I'm a bit lost here.
> 
> (gdb) where
> #0  0x00000001200074fc in write_func_for_structure (orig_s=0x120036550,
>     s=0x120036550, param=0x0, wtd=0x120017300)
>     at /home/rth/work/gcc/src-gcc/gcc/gengtype.c:2079
> #1  0x0000000120007ba0 in write_types (structures=0x1200bab80,
>     param_structs=0x1200270d0, wtd=0x120017300)
>     at /home/rth/work/gcc/src-gcc/gcc/gengtype.c:2221
> #2  0x000000012000a3ec in main (argc=1, argv=0x11ffb5ac8)
>     at /home/rth/work/gcc/src-gcc/gcc/gengtype.c:3083
> 
> 2079              if (orig_s->u.p->kind == TYPE_PARAM_STRUCT
> 2080                  && orig_s->u.p->u.s.line.file != NULL)
> 
> (gdb) p *orig_s
> $5 = {kind = TYPE_STRUCT, next = 0x120036260, pointer_to = 0x1200365e0,
>   gc_used = GC_POINTED_TO, u = {p = 0x120015ee2, s = {
>       tag = 0x120015ee2 "basic_block_def", line = {
>         file = 0x1200142e4 "/home/rth/work/gcc/src-gcc/gcc/basic-block.h",
>         line = 269}, fields = 0x1200607b0, opt = 0x12005f360, bitmap = 31,
>       lang_struct = 0x0}, sc = 0x120015ee2 "basic_block_def", a = {
>       p = 0x120015ee2,
>       len = 0x1200142e4 "/home/rth/work/gcc/src-gcc/gcc/basic-block.h"},
>     param_struct = {stru = 0x120015ee2, param = {0x1200142e4, 0x10d,
>         0x1200607b0, 0x12005f360, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0}, line = {
>         file = 0x0, line = 0}}}}
> 
> Note orig_s->u.p->kind is dereferencing readable ascii.  The member
> that appears to be valid is orig_s->u.s.
> 
> My guess is that this is a simple typo, fixed like so.  Correct?

This code's my fault.  It does look like you're right, though I'm not
sure how this never broke for me...

If so, there's a third instance in the same function.


-- 
Daniel Jacobowitz
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]