Hi! On 2021-11-09T11:54:04+0100, Richard Biener wrote: > On Tue, Nov 9, 2021 at 11:28 AM Thomas Schwinge wrote: >> On 2021-09-01T18:14:46-0600, Martin Sebor wrote: >> > On 9/1/21 1:35 PM, Thomas Schwinge wrote: >> >> On 2021-06-23T13:47:08-0600, Martin Sebor via Gcc-patches wrote: >> >>> --- /dev/null >> >>> +++ b/gcc/diagnostic-spec.h >> >> >> >>> +typedef location_t key_type_t; >> >>> +typedef int_hash xint_hash_t; >> >>> +typedef hash_map xint_hash_map_t; >> >>> + >> >>> +/* A mapping from the location of an expression to the warning spec >> >>> + set for it. */ >> >>> +extern GTY(()) xint_hash_map_t *nowarn_map; >> >> >> Oh, and one of [my pending changes] actually (unintentially so) happens to resolve >> >> "[12 Regression] infinite recursion in >> >> gtype-desc.c since r12-1801-g7036e9ef462fde8181bece4ac4e03f3aa27204dc", >> >> so unless you've done any work on that, may I take over that PR? >> > >> > I haven't. Thanks for offering to take it on! I'm curious to >> > hear how your change fixes that problem. >> >> So, instead of my earlier drive-by fix, I've since distilled what it >> actually is that is causing/fixing this (strange...) problem. OK to push >> the attached "Get rid of infinite recursion for 'typedef' used with >> GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204]"? (This, of >> course, only fixes the symptom but not the actual underlying problem. >> But I'm not going to dig deep into 'gengtype' at this time.) ;-) > > Did you try if > > typedef hash_map, nowarn_spec_t> > xint_hash_map_t; > > works? First, that would be in conflict with my goal of settling on a *single* 'location_hash' type, but also: no, 'gengtype' doesn't grok that either: In file included from config.h:8:0, from gtype-desc.c:21: [...]/source-gcc/gcc/../include/ansidecl.h:148:55: error: wrong number of template arguments (1, should be at least 2) # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) ^ gtype-desc.c:3014:37: note: in expansion of macro 'ATTRIBUTE_UNUSED' gt_ggc_mx (int_hash Usually a typedef is needed so that gengtype can grok struct > members but it > might very well be confused about two levels of typedefs here? > > That said ... I guess this kind of fix is OK - but can you please put > a big fat comment > about this in the actual code I had thought about that, but then decided not to do that, as the problem is general, not specific to this particular code. Instead, I had put something into 'gcc/doc/gty.texi'. Anyway, I've now put something into that place, too. > and open a bugreport tracking this > gengtype defect? "'gengtype': 'typedef' causing infinite-recursion code to be generated". Pushed to master branch commit c71cb26a9e841888f52e4bfcaad94c8f8ecb4fdb "Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204, PR103157]", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955