From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D14E387606A; Tue, 30 Jan 2024 12:45:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D14E387606A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706618756; bh=PMIuUXp+8+0yzIqolASGGr617smE8n2VkUIzYoYYqjQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lzsaWlUcW4cH9PmR5k+DHMqc7y4MB7bjOWnS26FYzQycDRAVq9TolK1IjE1yzTz01 7ZbUhu4IiSryGyEvMcoVK6vjGJkwSzYn0Az343E3WEZcoe+qdumFwkII8YW+5EvM8C X1i+WiwIu01yocwgg+VLB+8WtAVWXdDSr5o7ZCKA= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113617] [14 Regression] Symbol ... referenced in section `.data.rel.ro.local' of ...: defined in discarded section ... since r14-4944 Date: Tue, 30 Jan 2024 12:45:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: link-failure, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113617 --- Comment #14 from Jakub Jelinek --- The huge names make the assembly quite unreadable, so I've tried to reduce = it a little bit further: pr113617.h: namespace { template struct J { static constexpr int value =3D V; }; template using K =3D J; using M =3D K; template struct L { template using type =3D = _Tp; }; template using N =3D typename L<_Cond>::type<_If, _Else>; M k; template struct O { using type =3D _Tp; }; template struct P : N, _Up> {}; template struct Q { using type =3D typename P<_Tp>::type; }; } namespace R { struct H; enum G {}; template class S; struct T { using U =3D bool (*) (H &, const H &, G); U F; }; template class B; template struct B<_R(_A...), _F> { static bool F(H &, const H &, G) { return false; } __attribute__((noipa)) static _R bar(const H &) {} }; template struct S<_R(_A...)> : T { template using AH =3D B<_R(), _F>; template S(_F) { using AG =3D AH<_F>; barr =3D AG::bar; F =3D AG::F; } using AF =3D _R (*)(const H &); AF barr; }; template class I; template struct I<_F(_B...)> {}; template using W =3D decltype(k); template struct V { typedef I::type(typename Q<_B>::type...)> type; }; template __attribute__((noipa)) typename V::value, _F, _B...>::type baz(_F, _B...) { return typename V::value, _F, _B...>::type (); } template struct AJ { template struct _Ptr { using type =3D _Up *; }; using AI =3D typename _Ptr<_Tp>::type; }; template struct Y { using AI =3D typename AJ<_Tp>::AI; AI operator->(); }; } extern int z; namespace N1 { namespace N2 { namespace N3 { enum Z { Z1, Z2 }; template struct X { template __attribute__((noipa)) void boo(long long, long long, long long, _F &) {} }; struct AC { AC(int); void m1(R::S); }; template __attribute__((noipa)) void garply(void *, long long, long long, long long)= {} template <> template void X::boo(long long, long long x, long long y, _F &fi) { AC pool(z); for (;;) { auto job =3D R::baz(garply<_F>, &fi, y, y, x); pool.m1(job); } } struct AB { static AB &bleh(); template void boo(long first, long x, long y, _F fi) { switch (ab1) { case Z1: ab2->boo(first, x, y, fi); case Z2: ab3->boo(first, x, y, fi); } } Z ab1; R::Y> ab2; R::Y> ab3; }; template struct C; template struct C<_F, false> { __attribute__((noipa)) C(_F) {} void boo(long first, long x, long y) { auto u =3D AB::bleh(); u.boo(first, x, y, *this); } }; template struct AA { typedef C<_F, 0> type; }; } } } struct AD { template static void boo(long first, long x, long y, _F f) { typename N1::N2::N3::AA<_F>::type fi(f); fi.boo(first, x, y); } template static void boo(long first, long x, _F f) { boo(first, x, 0, f); } }; template struct A { void foo(long long, long long); int *c; }; namespace { template struct D { __attribute__((noipa)) D(int *) {} }; } template void A::foo(long long x, long long y) { int e; D d(&e); AD::boo(0, y, d); long p; for (p =3D 0; p < x; p++) c[p] =3D c[p - 1]; } pr113617.C: #include "pr113617.h" int z; long xx1; void corge() { A a; a.foo(xx1, 0); } pr113617-aux.cc: #include "pr113617.h" void qux() { A a; a.foo(0, 0); } >From what I can see, there is just one comdat group, _ZN1AIxE3fooExx, in the whole testcase, which contains everything instantiated because of the foo instantiation.=