This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make __PRETTY_FUNCTION__-like functions mergeable string csts (PR c++/64266).
- From: Jason Merrill <jason at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Pedro Alves <palves at redhat dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, wilson at gcc dot gnu dot org, Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 24 Oct 2018 13:24:48 -0400
- Subject: Re: [PATCH] Make __PRETTY_FUNCTION__-like functions mergeable string csts (PR c++/64266).
- References: <e506fecb-c2b2-ccd8-12dc-4300a481bf04@suse.cz> <20170425115827.GX1809@tucnak> <c0d13c44-48fb-44c1-6615-138258131935@suse.cz> <CADzB+2kMkQ2pSfukByRnRO-AHpriUdYnoEdwrKzgt+9n4geSbA@mail.gmail.com> <3b197eef-db36-7df9-417e-e17be0616b6c@suse.cz> <3f912b8a-0153-f559-e3fe-489b57800697@redhat.com> <894565dc-5c64-cb9f-8bb4-35ee7035c075@suse.cz> <CADzB+2n2bBg=HAX+Cu35FjHMBSMwVmrjEo721H1k-dh6au4xLA@mail.gmail.com> <47548cbc-69c9-d925-a107-891a960a2cd1@suse.cz> <CADzB+2=A0D995vi8A72wO0EOS1O59eODhiQSphHtD36e6nOy_w@mail.gmail.com> <714daf75-8c45-2503-23cc-675a7c258485@suse.cz> <7b6f3ceb-d303-4b45-5740-0f4a0f3059cf@suse.cz>
On Tue, Oct 23, 2018 at 4:59 AM Martin Liška <mliska@suse.cz> wrote:
> However, I still see some minor ICEs, it's probably related to decay_conversion in cp_fname_init:
>
> 1) ./xg++ -B. /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-__func__2.C
>
> /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-__func__2.C:6:17: internal compiler error: Segmentation fault
> 6 | [] { return __func__; }();
> | ^~~~~~~~
> 0x1344568 crash_signal
> /home/marxin/Programming/gcc/gcc/toplev.c:325
> 0x7ffff6bc310f ???
> /usr/src/debug/glibc-2.27-6.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
> 0x9db134 is_capture_proxy(tree_node*)
The problem in both tests is that is_capture_proxy thinks your
__func__ VAR_DECL with DECL_VALUE_EXPR is a capture proxy, since it is
neither an anonymous union proxy nor a structured binding.
The standard says,
The function-local predefined variable __func__ is defined as if a
definition of the form
static const char __func__[] = "function-name ";
had been provided, where function-name is an implementation-defined
string. It is unspecified whether such a variable has an address
distinct from that of any other object in the program.
So changing the type of __func__ (from array to pointer) still breaks
conformance. And we need to keep the type checks from pretty4.C, even
though the checks for strings being distinct need to go.
Jason