public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102454] New: [12 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2958
@ 2021-09-22 17:13 asolokha at gmx dot com
  2021-09-22 17:58 ` [Bug c++/102454] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: asolokha at gmx dot com @ 2021-09-22 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102454
           Summary: [12 Regression] ICE in gimplify_var_or_parm_decl, at
                    gimplify.c:2958
           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/torture/co-yield-04-complex-local-state.C, w/
-fcoroutines -fno-exceptions:

#include <coroutine>
#include <string>

template <typename T>
struct looper {
  struct promise_type {
    auto get_return_object () { return handle_type::from_promise (*this); }
    auto initial_suspend () { return suspend_always_prt {}; }
    auto final_suspend () noexcept { return suspend_always_prt {}; }
    void return_value (T);
    void unhandled_exception ();
  };

  using handle_type = std::coroutine_handle<promise_type>;

  looper (handle_type);

  struct suspend_always_prt {
    bool await_ready () noexcept;
    void await_suspend (handle_type) noexcept;
    void await_resume () noexcept;
  };
};

template <typename T>
looper<T>
with_ctorable_state (T)
{
  co_return T ();
}

auto
foo ()
{
  return with_ctorable_state<std::string>;
}

% g++-12.0.0 -fcoroutines -fno-exceptions -c n7pshqai.C
n7pshqai.C: In function 'looper<T> with_ctorable_state(T) [with T =
std::__cxx11::basic_string<char>]':
n7pshqai.C:27:1: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.c:2958
   27 | with_ctorable_state (T)
      | ^~~~~~~~~~~~~~~~~~~
0x7984d0 gimplify_var_or_parm_decl
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:2958
0xe96100 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:15029
0xeaefd3 gimplify_modify_expr
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:5960
0xe960ed gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:14568
0xeb0f2b gimplify_cleanup_point_expr
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:7006
0xe964f1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:14961
0xe999d6 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:7006
0xe9746b gimplify_statement_list
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:1997
0xe9746b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:15013
0xe999d6 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:7006
0xe9a28f gimplify_bind_expr
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:1426
0xe967b4 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:14769
0xeb04d6 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:7006
0xeb04d6 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:15814
0xeb094d gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/gimplify.c:15968
0xcce107 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cgraphunit.c:670
0xcd0d57 analyze_functions
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cgraphunit.c:1234
0xcd1a3d symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210919/work/gcc-12-20210919/gcc/cgraphunit.c:2508

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

end of thread, other threads:[~2023-05-08 12:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 17:13 [Bug c++/102454] New: [12 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.c:2958 asolokha at gmx dot com
2021-09-22 17:58 ` [Bug c++/102454] " pinskia at gcc dot gnu.org
2021-09-27 13:36 ` [Bug c++/102454] " marxin at gcc dot gnu.org
2021-09-27 18:40 ` iains at gcc dot gnu.org
2021-09-27 19:39 ` iains at gcc dot gnu.org
2021-09-28 18:54 ` cvs-commit at gcc dot gnu.org
2021-10-03 19:22 ` [Bug c++/102454] coroutines: " cvs-commit at gcc dot gnu.org
2021-11-25 17:51 ` asolokha at gmx dot com
2021-11-25 19:01 ` iains at gcc dot gnu.org
2022-05-06  8:31 ` jakub at gcc dot gnu.org
2023-05-08 12:22 ` 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).