public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273
@ 2021-09-26 11:05 asolokha at gmx dot com
  2021-09-27  8:39 ` [Bug c++/102489] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2021-09-26 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102489
           Summary: [12 Regression] ICE in is_this_parameter, at
                    cp/semantics.c:11273
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-12.0.0-alpha20210919 snapshot (g:32731fa5b0abf092029b8e2be64319b978bda514)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/coroutines/pr95736.C, w/ -O1 -fcoroutines:

#include <coroutine>

struct footask {
  struct promise_type {
    std::suspend_never initial_suspend();
    std::suspend_never final_suspend() noexcept;
    void unhandled_exception();
    void get_return_object();
  };

  std::suspend_always foo;

  footask taskfun() { co_await foo; }
};

% g++-12.0.0 -O1 -fcoroutines -c c3iikget.C
c3iikget.C: In function 'void
footask::taskfun(footask::taskfun()::_ZN7footask7taskfunEv.Frame*)':
c3iikget.C:13:37: internal compiler error: in is_this_parameter, at
cp/semantics.c:11273
   13 |   footask taskfun() { co_await foo; }
      |                                     ^
0x710dd0 is_this_parameter(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/semantics.c:11273
0x96f9ec potential_constant_expression_1
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:8393
0x970c87 potential_constant_expression_1
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:8200
0x971aa6 potential_constant_expression_1(tree_node*, bool, bool, bool, int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:9062
0x971aa6 is_constant_expression(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:9119
0x971aa6 is_nondependent_constant_expression(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:9156
0x9729ff maybe_constant_value(tree_node*, tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/constexpr.c:7628
0x9a042d cp_fold
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2656
0x9a0d0c cp_fold_maybe_rvalue(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2127
0x99ee00 cp_fold
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2361
0x9a0d0c cp_fold_maybe_rvalue(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2127
0x99f6b0 cp_fold_rvalue(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2150
0x99f6b0 cp_fold
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2253
0x9a0d0c cp_fold_maybe_rvalue(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2127
0x99f1ed cp_fold_rvalue(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2150
0x99f1ed cp_fold
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:2509
0x9a06de cp_fold_r
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cp/cp-gimplify.c:847
0x146728a walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/tree.c:11016
0x1467ab8 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/tree.c:11132
0x1467ab8 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/tree.c:11132

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

* [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
@ 2021-09-27  8:39 ` rguenth at gcc dot gnu.org
  2021-09-27 14:04 ` [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-09-27  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
  2021-09-27  8:39 ` [Bug c++/102489] " rguenth at gcc dot gnu.org
@ 2021-09-27 14:04 ` marxin at gcc dot gnu.org
  2021-09-27 15:23 ` iains at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-09-27 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |iains at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |is_this_parameter, at       |is_this_parameter, at
                   |cp/semantics.c:11273        |cp/semantics.c:11273 since
                   |                            |r12-3529-g70ee703c479081ac
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-09-27

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-3529-g70ee703c479081ac.

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

* [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
  2021-09-27  8:39 ` [Bug c++/102489] " rguenth at gcc dot gnu.org
  2021-09-27 14:04 ` [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac marxin at gcc dot gnu.org
@ 2021-09-27 15:23 ` iains at gcc dot gnu.org
  2022-01-20  9:50 ` [Bug c++/102489] [12 Regression] coroutines: " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2021-09-27 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=100476

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #0)
> g++-12.0.0-alpha20210919 snapshot
> (g:32731fa5b0abf092029b8e2be64319b978bda514) ICEs when compiling the
> following testcase, reduced from gcc/testsuite/g++.dg/coroutines/pr95736.C,
> w/ -O1 -fcoroutines:
> 
> #include <coroutine>
> 
> struct footask {
>   struct promise_type {
>     std::suspend_never initial_suspend();
>     std::suspend_never final_suspend() noexcept;
>     void unhandled_exception();
>     void get_return_object();
>   };
> 
>   std::suspend_always foo;
> 
>   footask taskfun() { co_await foo; }
> };

the use a of a void get_return_object() to invoke a default CTOR for the
coroutine object was allowed (and I think that there was some code in early
coroutines libraries that expected this to work).

However, see PR100476, where it is considered that this is not implied by the
standard wording.

Clearly, we should not ICE in any event - but this could well be reclassified
as ice-on-invalid (it is on the TODO to check / produce a suitable error).

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

* [Bug c++/102489] [12 Regression] coroutines: ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-09-27 15:23 ` iains at gcc dot gnu.org
@ 2022-01-20  9:50 ` rguenth at gcc dot gnu.org
  2022-03-21 16:51 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-20  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/102489] [12 Regression] coroutines: ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-01-20  9:50 ` [Bug c++/102489] [12 Regression] coroutines: " rguenth at gcc dot gnu.org
@ 2022-03-21 16:51 ` jakub at gcc dot gnu.org
  2022-03-21 21:19 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-21 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It is still a regression from GCC 11 and so a P1 and thus a GCC 12 release
blocker.

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

* [Bug c++/102489] [12 Regression] coroutines: ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-03-21 16:51 ` jakub at gcc dot gnu.org
@ 2022-03-21 21:19 ` iains at gcc dot gnu.org
  2022-03-22 14:42 ` cvs-commit at gcc dot gnu.org
  2022-03-22 14:44 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2022-03-21 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> It is still a regression from GCC 11 and so a P1 and thus a GCC 12 release
> blocker.

This PR was fixed by r12-5255-gdaa9c6b015, (and I added a test case for
PR96517) - I can add another one for this, if that seems useful, or we can just
close this as fixed.

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

* [Bug c++/102489] [12 Regression] coroutines: ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-03-21 21:19 ` iains at gcc dot gnu.org
@ 2022-03-22 14:42 ` cvs-commit at gcc dot gnu.org
  2022-03-22 14:44 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-22 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r12-7770-gb6e33907ebe89361f8ddfb7481534cbf4a97f213
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 22 15:37:20 2022 +0100

    testsuite: Add testcase for already fixed PR [PR102489]

    This got broken with r12-3529 and fixed with r12-5255.

    2022-03-22  Jakub Jelinek  <jakub@redhat.com>

            PR c++/102489
            * g++.dg/coroutines/pr102489.C: New test.

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

* [Bug c++/102489] [12 Regression] coroutines: ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac
  2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-03-22 14:42 ` cvs-commit at gcc dot gnu.org
@ 2022-03-22 14:44 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-22 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the testcase won't hurt.

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

end of thread, other threads:[~2022-03-22 14:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 11:05 [Bug c++/102489] New: [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 asolokha at gmx dot com
2021-09-27  8:39 ` [Bug c++/102489] " rguenth at gcc dot gnu.org
2021-09-27 14:04 ` [Bug c++/102489] [12 Regression] ICE in is_this_parameter, at cp/semantics.c:11273 since r12-3529-g70ee703c479081ac marxin at gcc dot gnu.org
2021-09-27 15:23 ` iains at gcc dot gnu.org
2022-01-20  9:50 ` [Bug c++/102489] [12 Regression] coroutines: " rguenth at gcc dot gnu.org
2022-03-21 16:51 ` jakub at gcc dot gnu.org
2022-03-21 21:19 ` iains at gcc dot gnu.org
2022-03-22 14:42 ` cvs-commit at gcc dot gnu.org
2022-03-22 14:44 ` jakub 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).