public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100673] New: [coroutines] Non-template, UDT await_suspend return-type results in ICE.
@ 2021-05-19 10:35 jehelset at gmail dot com
  2021-05-22  3:07 ` [Bug c++/100673] " jehelset at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jehelset at gmail dot com @ 2021-05-19 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100673
           Summary: [coroutines] Non-template, UDT await_suspend
                    return-type results in ICE.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 50844
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50844&action=edit
ICE on non-template UDT  await_suspend return-type.

A non-template udt return-type from await_suspend will ICE on trunk:

https://godbolt.org/z/Gn7djfrac

#0  build_co_await (loc=674010823, a=0x7ffff163f1c0, suspend_kind=<optimized
out>) at ../../gcc/cp/coroutines.cc:993
993           tree tt = CLASSTYPE_TI_TEMPLATE (susp_return_type);

Relevant code:
  else if (TREE_CODE (susp_return_type) == RECORD_TYPE
           && CLASS_TYPE_P (susp_return_type))
    {
      tree tt = CLASSTYPE_TI_TEMPLATE (susp_return_type);
      if (tt == coro_handle_templ)
        ok = true;
    }

Seems to be checking the validity of the await_suspend call, to produce a
helpful diagnostic. Perhaps the conditional also needs to verify that
CLASSTYPE_TEMPLATE_INFO (coro_handle_templ) is non-NULL, before using
CLASSTYPE_TI_TEMPLATE.

Seemed to be the case on 10.3, 11.1 and on 12.0. 10.2 failed to compile it
without crashing.

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

end of thread, other threads:[~2023-05-29 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 10:35 [Bug c++/100673] New: [coroutines] Non-template, UDT await_suspend return-type results in ICE jehelset at gmail dot com
2021-05-22  3:07 ` [Bug c++/100673] " jehelset at gmail dot com
2021-10-01 20:29 ` iains at gcc dot gnu.org
2021-10-01 20:30 ` iains at gcc dot gnu.org
2021-10-02 18:39 ` iains at gcc dot gnu.org
2021-10-03 19:50 ` cvs-commit at gcc dot gnu.org
2021-12-21 19:38 ` pinskia at gcc dot gnu.org
2023-05-29 15:03 ` jehelset at gmail dot com

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).