Is this a gcc problem?
I have tracked down a problem I've been seeing with gtk apps for quite
some time, where certain windows don't display properly... see
http://jekyl.ddts.net/~doug/control-center-1.jpg for an example. The
problem is in the GtkHPaned widget, specifically in how it calculates
a particular subwidget's size. However, the problem appears to be one
of code generation rather than a problem with the source. Here's the
relevant snippet, from gtk/gtkhpaned.c in libgtk1.2, near line 219
(the #if'd out part is the original; the #else part is my replacement):
/* N.B. the way this computation was being done is causing gcc to
emit bad code on Alpha??? */
#if 0
child2_allocation.x = paned->groove_rectangle.x + gutter_size / 2 +
1;
child2_allocation.width = MAX (1, (gint) allocation->width -
child2_allocation.x - border_width);
#else
{
gint child2_x = paned->groove_rectangle.x + gutter_size / 2 + 1;
child2_allocation.x = child2_x;
printf("child2_allocation.x as gint16: %d ; as gint: %d\n",
child2_allocation.x, child2_x);
child2_allocation.width = MAX (1, (gint) allocation->width -
child2_x - border_width);
}
#endif
The interesting thing to note is that child2_allocation looks like
this:
struct GtkAllocation
{
gint16 x;
gint16 y;
guint16 width;
guint16 height;
};
This looks like a gcc bug (and a bad one) to me. The two values
printf'd out are nearly always different.
I am going to try to narrow this down to a good test case and submit a
bug against gcc, but first I'm wondering if it rings a bell with
anyone?
Thanks,
-Doug
--
Doug Larrick doug@ties.org doug.larrick@compaq.com AIM: DougLarick
Reply to: