From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C7C873858D38; Mon, 19 Feb 2024 16:00:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7C873858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708358430; bh=yuE5hN7RUdqL+50TuaAe9qFgj8J/cZxbMVhTm7Rm948=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yQWo8CTqJxXlIg2VZhkvB9Z62asgQT68qvWJuC1hKyhmmOzPGjuAc9Tf4cOpJJgVg 4rl2Yi2KT1bKwAP7jc9mXV5ozfyV71n6Q7aTMVkM5pTdAcgCSarpgd7RxduPLvDp10 TYN8LOYMN2HhfhOuxaKRdhWMFj3x54xnXSw+8caQ= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113976] [11/12/13/14 Regression] explicit instantiation of const variable template following implicit instantiation is assembled in .rodata instead of .bss since r8-2857-g2ec399d8a6c9c2 Date: Mon, 19 Feb 2024 16:00:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D113976 --- Comment #6 from Jakub Jelinek --- Testcase showing that it is just this case of implicit instantiation follow= ed by explicit that is problematic: int foo () { return 42; } template const int a =3D foo (); const int *b =3D &a <0>; template const int c =3D foo (); template const int c <0>; template const int d =3D foo (); const int *e =3D &d <0>; template const int d <0>; template const int f =3D foo (); template const int f <0>; const int *g =3D &f <0>; int main () {}=