Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204] (was: [PATCH 1/13] v2 [PATCH 1/13] Add support for per-location warning groups (PR 74765))

Thomas Schwinge thomas@codesourcery.com
Tue Nov 9 10:28:20 GMT 2021


Hi!

On 2021-09-01T18:14:46-0600, Martin Sebor <msebor@gmail.com> wrote:
> On 9/1/21 1:35 PM, Thomas Schwinge wrote:
>> On 2021-06-23T13:47:08-0600, Martin Sebor via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>> --- /dev/null
>>> +++ b/gcc/diagnostic-spec.h
>>
>>> +typedef location_t key_type_t;
>>> +typedef int_hash <key_type_t, 0, UINT_MAX> xint_hash_t;
>>> +typedef hash_map<xint_hash_t, nowarn_spec_t> 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
>> <https://gcc.gnu.org/PR101204> "[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.)  ;-)


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Get-rid-of-infinite-recursion-for-typedef-used-with-.patch
Type: text/x-diff
Size: 3274 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211109/f99ffd81/attachment.bin>


More information about the Gcc-patches mailing list