egcs-1.0: generated code for sparc-sun-solaris2.5.1 produces bus error on sun4m

Sebastian Wilhelmi wilhelmi@ira.uka.de
Mon Dec 8 01:44:00 GMT 1997


Hi!

I have installed egcs-1.0 on a `SunOS 5.5.1 Generic sun4m` system:
gcc -v -> gcc version egcs-2.90.21 971202 (egcs-1.00 release)

I compiled gtk+-971201, and than a bus error occurs at line 1099 of file
gtksignal.h. This is called by line 1146 of the same file. Here is the
snippet:

1083 static gint
1084 gtk_emission_check (GList     *emissions,
1085                     GtkObject *object,
1086                     gint       signal_type)
1087 {
1088   GtkEmission *emission;
1089   GList *tmp;
1090 
1091   g_return_val_if_fail (object != NULL, FALSE);
1092 
1093   tmp = emissions;
1094   while (tmp)
1095     {
1096       emission = tmp->data;
1097       tmp = tmp->next;
1098 
1099       if ((emission->object == object) &&
1100           (emission->signal_type == signal_type))
1101         return TRUE;
1102     }
1103   return FALSE;
1104 }
1105 
1106 static gint
1107 gtk_handlers_run (GtkHandler     *handlers,
1108                   GtkHandlerInfo *info,
1109                   gint            after)
1110 {
1111   while (handlers && (handlers->signal_type == info->signal_type))
1112     {
1113       if (!handlers->blocked && (handlers->after == after))
1114         {
1115           if (handlers->func)
1116             {
1117               if (handlers->no_marshal)
1118                 (* (GtkCallbackMarshal)handlers->func)
(info->object,
1119                                           handlers->func_data,
1120                                           info->nparams,
1121                                           info->params);
1122               else if (handlers->object_signal)
1123                 (* info->marshaller) (GTK_OBJECT
(handlers->func_data),
1124                                       handlers->func,
1125                                       handlers->func_data,
1126                                       info->params);
1127               else
1128                 (* info->marshaller) (info->object,
1129                                       handlers->func,
1130                                       handlers->func_data,
1131                                       info->params);
1132             }
1133           else if (marshal)
1134             (* marshal) (info->object,
1135                          handlers->func_data,
1136                          info->nparams,
1137                          info->params,
1138                          info->param_types,
1139                          info->return_val);
1140 
1141           if (GTK_OBJECT_NEED_DESTROY (info->object))
1142             return DONE;
1143           else if (gtk_emission_check (stop_emissions,
info->object, 	info->signal_type))
1144             {
1145               gtk_emission_remove (&stop_emissions, info->object,
info->signal_type);
1146 
1147               if (info->run_type & GTK_RUN_NO_RECURSE)
1148                 gtk_emission_remove (&restart_emissions,
info->object, info->signal_type);
1149               return DONE;
1150             }
1151           else if ((info->run_type & GTK_RUN_NO_RECURSE) &&
1152                    gtk_emission_check (restart_emissions,
info->object, info->signal_type))
1153             {
1154               gtk_emission_remove (&restart_emissions,
info->object, info->signal_type);
1155               return RESTART;
1156             }
1157         }
1158 
1159       handlers = handlers->next;
1160     }
1161 
1162   return 0;
1163 }

So, the problem occures, because restart_emissions in function
gtk_handlers_run has the value 0x36f18, wehereas emissions in function
gtk_emission_check has the value 0x36, which is not properly aligned.
The point (that lets me believe, its an compiler OR processor bug) is,
that on other Sparc processors like sun4u and sun4c this is working, but
on every sun4m, I testet this, it failed....

I include the assembler code of the above snippet. It is compiled with
the same ggc-options (only -S instead og -c ;-):
These are:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../glib -I/usr/openwin/include
-g -O2 -DNDEBUG -DUSE_XIM -c -fPIC -DPIC gtksignal.c
The result for the two functions gtk_handlers_run and gtk_emission_check
is as follows:

-------------------------------------------------
.LLC42:
        .asciz  "gtk_emission_check"
.section        ".text"
        .align 4
.stabs "gtk_emission_check:f(22,4)",36,0,1087,gtk_emission_check
.stabs "emissions:P(22,70)",64,0,1084,8
.stabs "object:P(32,24)",64,0,1085,10
.stabs "signal_type:P(22,4)",64,0,1086,11
        .type    gtk_emission_check,#function
        .proc   04
gtk_emission_check:
.stabn 68,0,1087,.LM454-gtk_emission_check
.LM454:
        !#PROLOGUE# 0
        save %sp,-112,%sp
.LL354:
        call .LL355
        sethi %hi(_GLOBAL_OFFSET_TABLE_-(.LL354-.)),%l7
.LL355:
.LLBB30:
        or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(.LL354-.)),%l7
        add %l7,%o7,%l7
        orcc %i1,0,%o2
.stabn 68,0,1087,.LM455-gtk_emission_check
.LM455:
        mov %i0,%o0
.stabn 68,0,1091,.LM456-gtk_emission_check
.LM456:
        bne .LL348
        mov %i2,%o3
        sethi %hi(.LLC1),%o0
        or %o0,%lo(.LLC1),%o0
        sethi %hi(.LLC2),%o1
        or %o1,%lo(.LLC2),%o1
        sethi %hi(.LLC42),%o3
        ld [%l7+%o0],%o0
        sethi %hi(.LLC10),%o2
        ld [%l7+%o1],%o1
        or %o2,%lo(.LLC10),%o2
        ld [%l7+%o2],%o4
        or %o3,%lo(.LLC42),%o3
        ld [%l7+%o3],%o3
        call g_warning,0
        mov 1091,%o2
        b .LL356
        mov 0,%i0
.LL357:
.stabn 68,0,1101,.LM457-gtk_emission_check
.LM457:
        b .LL356
        mov 1,%i0
.LL348:
.stabn 68,0,1093,.LM458-gtk_emission_check
.LM458:
        mov %o0,%i0
.stabn 68,0,1094,.LM459-gtk_emission_check
.LM459:
.LL358:
        cmp %i0,0
.LL359:
        be,a .LL350
        mov 0,%i0
.stabn 68,0,1096,.LM460-gtk_emission_check
.LM460:
        ld [%i0],%o1
.stabn 68,0,1099,.LM461-gtk_emission_check
.LM461:
        ld [%o1],%o0
.stabn 68,0,1099,.LM462-gtk_emission_check
.LM462:
        cmp %o0,%o2
        bne .LL358
        ld [%i0+4],%i0
        ld [%o1+4],%o0
        cmp %o0,%o3
        be .LL357
        cmp %i0,0
.stabn 68,0,1102,.LM463-gtk_emission_check
.LM463:
        b,a .LL359
.LL350:
.stabn 68,0,1103,.LM464-gtk_emission_check
.LM464:
.LL356:
.LLBE30:
        ret
        restore
.LLfe37:
        .size    gtk_emission_check,.LLfe37-gtk_emission_check
.stabs "emission:r(0,42)",64,0,1088,9
.stabs "tmp:r(22,70)",64,0,1089,24
.stabn 192,0,0,.LLBB30-gtk_emission_check
.stabn 224,0,0,.LLBE30-gtk_emission_check
.LLscope36:
.stabs "",36,0,0,.LLscope36-gtk_emission_check
        .align 4
.stabs "gtk_handlers_run:f(22,4)",36,0,1110,gtk_handlers_run
.stabs "handlers:P(0,34)",64,0,1107,17
.stabs "info:P(0,44)=*(0,26)",64,0,1108,16
.stabs "after:P(22,4)",64,0,1109,20
        .type    gtk_handlers_run,#function
        .proc   04
gtk_handlers_run:
.stabn 68,0,1110,.LM465-gtk_handlers_run
.LM465:
        !#PROLOGUE# 0
        save %sp,-112,%sp
.LL380:
        call .LL381
        sethi %hi(_GLOBAL_OFFSET_TABLE_-(.LL380-.)),%l7
.LL381:
        or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(.LL380-.)),%l7
        add %l7,%o7,%l7
        orcc %i0,0,%l1
.stabn 68,0,1110,.LM466-gtk_handlers_run
.LM466:
        mov %i1,%l0
.stabn 68,0,1111,.LM467-gtk_handlers_run
.LM467:
        be .LL362
        mov %i2,%l4
        sethi %hi(8191),%o0
        or %o0,%lo(8191),%l3
        sethi %hi(marshal),%i0
        or %i0,%lo(marshal),%i0
        sethi %hi(stop_emissions),%o1
        or %o1,%lo(stop_emissions),%o1
        sethi %hi(restart_emissions),%i1
        or %i1,%lo(restart_emissions),%i1
        sethi %hi(restart_emissions),%o0
        ld [%l7+%o1],%l2
        or %o0,%lo(restart_emissions),%o0
        ld [%l7+%o0],%i2
        ld [%l1],%o2
.LL386:
        ld [%l0+28],%o1
        srl %o2,3,%o0
        and %o0,%l3,%o0
        cmp %o0,%o1
        bne .LL362
        andcc %o2,2,%g0
.stabn 68,0,1113,.LM468-gtk_handlers_run
.LM468:
        bne,a .LL385
        ld [%l1+20],%l1
        and %o2,1,%o0
        cmp %o0,%l4
        bne,a .LL385
        ld [%l1+20],%l1
.stabn 68,0,1115,.LM469-gtk_handlers_run
.LM469:
        ld [%l1+8],%o5
        cmp %o5,0
        be,a .LL366
        ld [%l7+%i0],%o0
.stabn 68,0,1117,.LM470-gtk_handlers_run
.LM470:
        ld [%l1+4],%o0
        cmp %o0,0
        bge .LL367
        andcc %o2,4,%g0
.stabn 68,0,1118,.LM471-gtk_handlers_run
.LM471:
        ld [%l0],%o0
        ld [%l1+12],%o1
        ld [%l0+24],%o2
        call %o5,0
        ld [%l0+8],%o3
        b .LL384
        ld [%l0],%o1
.LL367:
.stabn 68,0,1122,.LM472-gtk_handlers_run
.LM472:
        be .LL369
        mov %o5,%o1
.stabn 68,0,1123,.LM473-gtk_handlers_run
.LM473:
        ld [%l1+12],%o0
        ld [%l0+8],%o3
        ld [%l0+4],%o4
        call %o4,0
        mov %o0,%o2
        b .LL384
        ld [%l0],%o1
.LL369:
.stabn 68,0,1128,.LM474-gtk_handlers_run
.LM474:
        ld [%l0],%o0
        ld [%l1+12],%o2
        ld [%l0+8],%o3
        ld [%l0+4],%o4
        call %o4,0
        mov %o5,%o1
.stabn 68,0,1132,.LM475-gtk_handlers_run
.LM475:
        b .LL384
        ld [%l0],%o1
.LL366:
.stabn 68,0,1133,.LM476-gtk_handlers_run
.LM476:
        ld [%o0],%g2
        cmp %g2,0
        be,a .LL384
        ld [%l0],%o1
.stabn 68,0,1134,.LM477-gtk_handlers_run
.LM477:
        ld [%l0],%o0
        ld [%l1+12],%o1
        ld [%l0+24],%o2
        ld [%l0+8],%o3
        ld [%l0+12],%o4
        call %g2,0
        ld [%l0+16],%o5
.stabn 68,0,1141,.LM478-gtk_handlers_run
.LM478:
        ld [%l0],%o1
.LL384:
        ld [%o1],%o0
        andcc %o0,1,%g0
        be,a .LL373
        ld [%l2],%o0
.stabn 68,0,1142,.LM479-gtk_handlers_run
.LM479:
        b .LL382
        mov 1,%i0
.LL373:
.stabn 68,0,1143,.LM480-gtk_handlers_run
.LM480:
        call gtk_emission_check,0
        ld [%l0+28],%o2
        cmp %o0,0
        be,a .LL375
        ld [%l0+20],%o0
.stabn 68,0,1145,.LM481-gtk_handlers_run
.LM481:
        ld [%l0],%o1
        ld [%l0+28],%o2
        call gtk_emission_remove,0
        mov %l2,%o0
.stabn 68,0,1147,.LM482-gtk_handlers_run
.LM482:
        ld [%l0+20],%o0
        andcc %o0,16,%g0
        be .LL382
        mov 1,%i0
.stabn 68,0,1148,.LM483-gtk_handlers_run
.LM483:
        ld [%l7+%i1],%o0
        ld [%l0],%o1
        call gtk_emission_remove,0
        ld [%l0+28],%o2
.stabn 68,0,1149,.LM484-gtk_handlers_run
.LM484:
        b .LL382
        mov 1,%i0
.LL375:
.stabn 68,0,1151,.LM485-gtk_handlers_run
.LM485:
        andcc %o0,16,%g0
        be,a .LL385
        ld [%l1+20],%l1
        ld [%i2],%o0
        ld [%l0],%o1
        call gtk_emission_check,0
        ld [%l0+28],%o2
        cmp %o0,0
        be,a .LL365
        ld [%l1+20],%l1
.stabn 68,0,1154,.LM486-gtk_handlers_run
.LM486:
        ld [%l0],%o1
        ld [%l0+28],%o2
        call gtk_emission_remove,0
        mov %i2,%o0
.stabn 68,0,1155,.LM487-gtk_handlers_run
.LM487:
        b .LL382
        mov 2,%i0
.LL365:
.stabn 68,0,1160,.LM488-gtk_handlers_run
.LM488:
.LL385:
        cmp %l1,0
        bne,a .LL386
        ld [%l1],%o2
.LL362:
.stabn 68,0,1162,.LM489-gtk_handlers_run
.LM489:
        mov 0,%i0
.LL382:
        ret
        restore
.LLfe38:
        .size    gtk_handlers_run,.LLfe38-gtk_handlers_run
.LLscope37:
.stabs "",36,0,0,.LLscope37-gtk_handlers_run
.section        ".rodata"
        .align 8
------------------------------------------------------------

With best Regards
Sebastian.

-- 
+--------------============##################============--------------+
| Sebastian Wilhelmi, Institut fuer Rechnerentwurf und Fehlertoleranz, |
| Universitaet Karlsruhe;  Gebaeude 20.20, Raum 263, D-76128 Karlsruhe |
| mail: wilhelmi@ira.uka.de; fax: +49 721 370455; fon: +49 721 6084353 |
+----------------> http://goethe.ira.uka.de/~wilhelmi <----------------+



More information about the Gcc-bugs mailing list