Bug 54809 - gengtype ignore mark_hook in struct nested in union
gengtype ignore mark_hook in struct nested in union
Product: gcc
Classification: Unclassified
Component: middle-end
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
Depends on:
  Show dependency treegraph
Reported: 2012-10-04 08:04 UTC by Basile Starynkevitch
Modified: 2012-10-04 08:11 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:

small example to feed to gengtype (466 bytes, text/x-chdr)
2012-10-04 08:04 UTC, Basile Starynkevitch
patch to gengtype.c (999 bytes, patch)
2012-10-04 08:05 UTC, Basile Starynkevitch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basile Starynkevitch 2012-10-04 08:04:18 UTC
Created attachment 28353 [details]
small example to feed to gengtype

See http://gcc.gnu.org/ml/gcc-patches/2012-10/msg00257.html

The attached basilemarkh.h contains a GTY-ed struct mytest_st with a mark_hook. That struct mytest_st is a member of some GTY-ed union myutest_un.

No call to the mark_hook is generated by gengtype (both on GCC 4.7 and on 4.8 trunk).

The attached patch to gengtype.c (for GCC 4.8 trunk svn rev 192031) solves the issue
Comment 1 Basile Starynkevitch 2012-10-04 08:05:00 UTC
Created attachment 28354 [details]
patch to gengtype.c
Comment 2 Basile Starynkevitch 2012-10-04 08:09:42 UTC
   gengtype  -D -v \
   -r gtype.state \
   -P _g-basilemarkh.h basilemarkh.h

The bug appears on GCC 4.6, GCC 4.7 and GCC 4.8 (trunk svn rev 192031)