Message ID | 20121003110244.GA13256@hector.lesours |
---|---|
State | New |
Headers | show |
On Wed, Oct 03, 2012 at 01:02:44PM +0200, Basile Starynkevitch wrote: > On Wed, Oct 03, 2012 at 12:21:02PM +0300, Laurynas Biveinis wrote: > > Hello Basile - > > > > > 2012-10-02 Basile Starynkevitch <basile@starynkevitch.net> > > > > > > * gengtype.c (walk_type): Emit mark_hook when inside a > > > struct of a union member. > > > > Can you send me off-list the gengtype output before and after the fix? > > I messed something, the example I did send was wrong. Let's start all over again. > > Consider the following file [...] This is PR54809 on our bugzilla. Thanks.
> 2012-10-03 Basile Starynkevitch <basile@starynkevitch.net> > > * gengtype.c (walk_type): Emit mark_hook when inside a > struct of a union member. This is OK. Thanks,
On Thu, Oct 04, 2012 at 06:51:35PM +0300, Laurynas Biveinis wrote: > > 2012-10-03 Basile Starynkevitch <basile@starynkevitch.net> > > > > * gengtype.c (walk_type): Emit mark_hook when inside a > > struct of a union member. > > This is OK. thanks, Committed revision 192092 to trunk. I believe this patch should be backported into GCC 4.7 and 4.6 Regards.
On Thu, Oct 4, 2012 at 7:24 PM, Basile Starynkevitch <basile@starynkevitch.net> wrote: > On Thu, Oct 04, 2012 at 06:51:35PM +0300, Laurynas Biveinis wrote: >> > 2012-10-03 Basile Starynkevitch <basile@starynkevitch.net> >> > >> > * gengtype.c (walk_type): Emit mark_hook when inside a >> > struct of a union member. >> >> This is OK. > > thanks, Committed revision 192092 to trunk. > > > I believe this patch should be backported into GCC 4.7 and 4.6 I see no reason for this unless it is a regression. Richard. > Regards. > -- > Basile STARYNKEVITCH http://starynkevitch.net/Basile/ > email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 > 8, rue de la Faiencerie, 92340 Bourg La Reine, France > *** opinions {are only mines, sont seulement les miennes} ***
On Thu, Oct 04, 2012 at 07:26:23PM +0200, Richard Guenther wrote: > On Thu, Oct 4, 2012 at 7:24 PM, Basile Starynkevitch > <basile@starynkevitch.net> wrote: > > On Thu, Oct 04, 2012 at 06:51:35PM +0300, Laurynas Biveinis wrote: > >> > 2012-10-03 Basile Starynkevitch <basile@starynkevitch.net> > >> > > >> > * gengtype.c (walk_type): Emit mark_hook when inside a > >> > struct of a union member. > >> > >> This is OK. > > > > thanks, Committed revision 192092 to trunk. > > > > > > I believe this patch should be backported into GCC 4.7 and 4.6 > > I see no reason for this unless it is a regression. If GCC 4.7 will have future micro releases, (like an hypothetical 4.7.3) they will have the same bug. What is the procedure to get this bug fixed in 4.7.3? (and there are plugins for 4.7 affected by this bug, http://gcc-melt.org/ for example) Regards.
Index: gcc/gengtype.c =================================================================== --- gcc/gengtype.c (revision 192031) +++ gcc/gengtype.c (working copy) @@ -2810,6 +2810,7 @@ walk_type (type_p t, struct walk_type_data *d) const char *oldval = d->val; const char *oldprevval1 = d->prev_val[1]; const char *oldprevval2 = d->prev_val[2]; + const char *struct_mark_hook = NULL; const int union_p = t->kind == TYPE_UNION; int seen_default_p = 0; options_p o; @@ -2833,7 +2834,14 @@ walk_type (type_p t, struct walk_type_data *d) if (!desc && strcmp (o->name, "desc") == 0 && o->kind == OPTION_STRING) desc = o->info.string; + else if (!struct_mark_hook && strcmp (o->name, "mark_hook") == 0 + && o->kind == OPTION_STRING) + struct_mark_hook = o->info.string; + if (struct_mark_hook) + oprintf (d->of, "%*s%s (&%s));\n", + d->indent, "", struct_mark_hook, oldval); + d->prev_val[2] = oldval; d->prev_val[1] = oldprevval2; if (union_p)