From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7EBCF3858C27; Tue, 12 Oct 2021 20:44:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7EBCF3858C27 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/102718] New: gtype-desc.c function redefinition error for gt_ggc_xxx (int_hash&) Date: Tue, 12 Oct 2021 20:44:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2021 20:44:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102718 Bug ID: 102718 Summary: gtype-desc.c function redefinition error for gt_ggc_xxx (int_hash&) Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- This is to make a record of a bug in GCC's garbage collection machinery. W= ith the following patch I get the errors below. gtype-desc.c is a generated fi= le and the errors are due to the gengtype tool generating two definitions of t= he gt_ggc_xxx functions, one for each specialization of the hash_map. It seems that it's not possible to have two hash_maps with keys of distinct types but the same element type. diff --git a/gcc/diagnostic-spec.c b/gcc/diagnostic-spec.c index 85ffb725c02..dc98696132a 100644 --- a/gcc/diagnostic-spec.c +++ b/gcc/diagnostic-spec.c @@ -108,6 +108,7 @@ nowarn_spec_t::nowarn_spec_t (opt_code opt) /* A mapping from a 'location_t' to the warning spec set for it. */ GTY(()) xint_hash_map_t *nowarn_map; +extern GTY(()) int_hash_map_t *nowarn_map_2; /* Return the no-warning disposition for location LOC and option OPT or for all/any otions by default. */ diff --git a/gcc/diagnostic-spec.h b/gcc/diagnostic-spec.h index 9b3aaaa3ce6..b1fb304c2f3 100644 --- a/gcc/diagnostic-spec.h +++ b/gcc/diagnostic-spec.h @@ -136,4 +136,8 @@ typedef hash_map xint_hash_map_t; /* A mapping from a 'location_t' to the warning spec set for it. */ extern GTY(()) xint_hash_map_t *nowarn_map; +typedef int_hash int_hash_t; +typedef hash_map int_hash_map_t; +extern GTY(()) int_hash_map_t *nowarn_map_2; + #endif // DIAGNOSTIC_SPEC_H_INCLUDED synchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qu= al -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common=20 -DHAVE_CONFIG_H -I. -I. -I/src/gcc/master/gcc -I/src/gcc/master/gcc/. -I/src/gcc/master/gcc/../include -I/src/gcc/master/gcc/../libcpp/include -I/src/gcc/master/gcc/../libcody -I/src/gcc/master/gcc/../libdecnumber -I/src/gcc/master/gcc/../libdecnumber/bid -I../libdecnumber -I/src/gcc/master/gcc/../libbacktrace -o gtype-desc.o -MT gtype-desc.o -M= MD -MP -MF ./.deps/gtype-desc.TPo gtype-desc.c gtype-desc.c:3037:1: error: redefinition of =E2=80=98void gt_ggc_mx(nowarn_= spec_t&)=E2=80=99 gt_ggc_mx (struct nowarn_spec_t& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:3014:1: note: =E2=80=98void gt_ggc_mx(nowarn_spec_t&)=E2=80=99= previously defined here gt_ggc_mx (struct nowarn_spec_t& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:3043:1: error: redefinition of =E2=80=98void gt_ggc_mx(int_has= h&)=E2=80=99 gt_ggc_mx (int_hash& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:3020:1: note: =E2=80=98void gt_ggc_mx(int_hash&)=E2=80=99 previously defined here gt_ggc_mx (int_hash& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:6999:1: error: redefinition of =E2=80=98void gt_pch_nx(nowarn_= spec_t&)=E2=80=99 gt_pch_nx (struct nowarn_spec_t& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:6976:1: note: =E2=80=98void gt_pch_nx(nowarn_spec_t&)=E2=80=99= previously defined here gt_pch_nx (struct nowarn_spec_t& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:7005:1: error: redefinition of =E2=80=98void gt_pch_nx(int_has= h&)=E2=80=99 gt_pch_nx (int_hash& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:6982:1: note: =E2=80=98void gt_pch_nx(int_hash&)=E2=80=99 previously defined here gt_pch_nx (int_hash& x_r ATTRIBUTE_UNUSED) ^~~~~~~~~ gtype-desc.c:11395:1: error: redefinition of =E2=80=98void gt_pch_nx(nowarn= _spec_t*, gt_pointer_operator, void*)=E2=80=99 gt_pch_nx (struct nowarn_spec_t* x ATTRIBUTE_UNUSED, ^~~~~~~~~ gtype-desc.c:11369:1: note: =E2=80=98void gt_pch_nx(nowarn_spec_t*, gt_pointer_operator, void*)=E2=80=99 previously defined here gt_pch_nx (struct nowarn_spec_t* x ATTRIBUTE_UNUSED, ^~~~~~~~~ gtype-desc.c:11402:1: error: redefinition of =E2=80=98void gt_pch_nx(int_ha= sh*, gt_pointer_operator, void*)=E2=80=99 gt_pch_nx (int_hash* x ATTRIBUTE_UNUSED, ^~~~~~~~~ gtype-desc.c:11376:1: note: =E2=80=98void gt_pch_nx(int_hash*, gt_pointer_operator, void*)=E2=80=99 previously defined here gt_pch_nx (int_hash* x ATTRIBUTE_UNUSED, ^~~~~~~~~=