public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro
@ 2022-06-01 21:18 unlvsur at live dot com
  2022-06-01 21:23 ` [Bug c++/105809] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: unlvsur at live dot com @ 2022-06-01 21:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

            Bug ID: 105809
           Summary: GCC ICE when deal with __PRETTY_FUNCTION__ inside
                    macro
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

GCC ICE:
https://godbolt.org/z/Gfzov4j3b
clang:
https://godbolt.org/z/ebdPPK77r

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] GCC ICE when deal with __PRETTY_FUNCTION__ inside macro
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
@ 2022-06-01 21:23 ` pinskia at gcc dot gnu.org
  2022-06-01 21:32 ` [Bug c++/105809] [10/11/12/13 Regression] " mpolacek at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-01 21:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 53065
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53065&action=edit
testcase from the URL

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] GCC ICE when deal with __PRETTY_FUNCTION__ inside macro
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
  2022-06-01 21:23 ` [Bug c++/105809] " pinskia at gcc dot gnu.org
@ 2022-06-01 21:32 ` mpolacek at gcc dot gnu.org
  2022-06-01 21:35 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-06-01 21:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|GCC ICE when deal with      |[10/11/12/13 Regression]
                   |__PRETTY_FUNCTION__ inside  |GCC ICE when deal with
                   |macro                       |__PRETTY_FUNCTION__ inside
                   |                            |macro
   Last reconfirmed|                            |2022-06-01
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The ICE started with

commit 12659e10c78200717fc82ed77892de5059fa44b5
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Aug 29 15:40:08 2017 -0400

    Instantiate default arguments/member initializers once.

            * init.c (get_nsdmi): Remember NSDMI instantiations.
            * parser.c (inject_this_parameter): Be more picky about
            current_class_ptr.
            * pt.c (tsubst_copy): Simplify 'this' handling.
            (tsubst_default_argument): Remember default argument
            instantiations.  Take parameter number.
            (tsubst_default_arguments): Pass it.
            * call.c (convert_default_arg): Likewise.

    From-SVN: r251422

which is GCC 8.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] GCC ICE when deal with __PRETTY_FUNCTION__ inside macro
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
  2022-06-01 21:23 ` [Bug c++/105809] " pinskia at gcc dot gnu.org
  2022-06-01 21:32 ` [Bug c++/105809] [10/11/12/13 Regression] " mpolacek at gcc dot gnu.org
@ 2022-06-01 21:35 ` pinskia at gcc dot gnu.org
  2022-06-01 21:38 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-01 21:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
template<typename ss> void hh() {  ss t; }

template<int>
int f(void)
{
    constexpr char const* cc = __PRETTY_FUNCTION__;
    struct j{  char const* kk=cc; };
    hh<j>();
}

int t = f<1>();

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] GCC ICE when deal with __PRETTY_FUNCTION__ inside macro
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2022-06-01 21:35 ` pinskia at gcc dot gnu.org
@ 2022-06-01 21:38 ` pinskia at gcc dot gnu.org
  2022-06-28 10:49 ` [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-01 21:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code,
                   |                            |rejects-valid

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> The ICE started with

But the 7.x ICEd on and rejected the original testcase:
template<typename ss> void hh() {  ss t; }
template<typename ss>
struct tt {     ss t;  };


template<int>
int f(void)
{
    constexpr char const* cc = __PRETTY_FUNCTION__;
    struct j{  char const* kk=cc; };
    tt<j> y;
    hh<j>();
}

int t = f<1>();

GCC 8+ accepts the above code though.
So in summary, the ICE is a regression but the rejects valid is not and could
be workaround by using a struct first?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2022-06-01 21:38 ` pinskia at gcc dot gnu.org
@ 2022-06-28 10:49 ` jakub at gcc dot gnu.org
  2022-10-19 10:16 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2022-06-28 10:49 ` [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI jakub at gcc dot gnu.org
@ 2022-10-19 10:16 ` rguenth at gcc dot gnu.org
  2023-03-16 19:19 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-19 10:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2022-10-19 10:16 ` rguenth at gcc dot gnu.org
@ 2023-03-16 19:19 ` jason at gcc dot gnu.org
  2023-03-16 22:12 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2023-03-16 19:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
                 CC|                            |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2023-03-16 19:19 ` jason at gcc dot gnu.org
@ 2023-03-16 22:12 ` cvs-commit at gcc dot gnu.org
  2023-04-18 20:46 ` [Bug c++/105809] [10/11/12 " cvs-commit at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug c++/105809] [11 " rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-16 22:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:78b3bf0e65072f5fa42a8da43698711220d4f8ef

commit r13-6723-g78b3bf0e65072f5fa42a8da43698711220d4f8ef
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Mar 16 15:35:15 2023 -0400

    c++: __func__ and local class DMI [PR105809]

    As in 108242, we need to instantiate in the context of the enclosing
    function, not after it's gone.

            PR c++/105809

    gcc/cp/ChangeLog:

            * init.cc (get_nsdmi): Split out...
            (maybe_instantiate_nsdmi_init): ...this function.
            * cp-tree.h: Declare it.
            * pt.cc (tsubst_expr): Use it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/constexpr-__func__3.C: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [10/11/12 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2023-03-16 22:12 ` cvs-commit at gcc dot gnu.org
@ 2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug c++/105809] [11 " rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-18 20:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:dbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0

commit r12-9438-gdbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Mar 16 15:35:15 2023 -0400

    c++: __func__ and local class DMI [PR105809]

    As in 108242, we need to instantiate in the context of the enclosing
    function, not after it's gone.

            PR c++/105809

    gcc/cp/ChangeLog:

            * init.cc (get_nsdmi): Split out...
            (maybe_instantiate_nsdmi_init): ...this function.
            * cp-tree.h: Declare it.
            * pt.cc (tsubst_expr): Use it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/constexpr-__func__3.C: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/105809] [11 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI
  2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2023-04-18 20:46 ` [Bug c++/105809] [10/11/12 " cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:43 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01 21:18 [Bug c++/105809] New: GCC ICE when deal with __PRETTY_FUNCTION__ inside macro unlvsur at live dot com
2022-06-01 21:23 ` [Bug c++/105809] " pinskia at gcc dot gnu.org
2022-06-01 21:32 ` [Bug c++/105809] [10/11/12/13 Regression] " mpolacek at gcc dot gnu.org
2022-06-01 21:35 ` pinskia at gcc dot gnu.org
2022-06-01 21:38 ` pinskia at gcc dot gnu.org
2022-06-28 10:49 ` [Bug c++/105809] [10/11/12/13 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI jakub at gcc dot gnu.org
2022-10-19 10:16 ` rguenth at gcc dot gnu.org
2023-03-16 19:19 ` jason at gcc dot gnu.org
2023-03-16 22:12 ` cvs-commit at gcc dot gnu.org
2023-04-18 20:46 ` [Bug c++/105809] [10/11/12 " cvs-commit at gcc dot gnu.org
2023-07-07 10:43 ` [Bug c++/105809] [11 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).