public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107218] New: [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
@ 2022-10-11 17:00 asolokha at gmx dot com
  2022-10-12  7:51 ` [Bug c++/107218] " marxin at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: asolokha at gmx dot com @ 2022-10-11 17:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107218
           Summary: [13 Regression] ICE in cp_gimplify_init_expr, at
                    cp/cp-gimplify.cc:253
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++ 13.0.0 20221009 snapshot (g:e95e91eccd022a4a3a86da2749809fbad9afd20e) ICEs
when compiling the following testcase, reduced from
clang/testsuite/SemaCXX/cxx2a-consteval.cpp from the clang 15.0.1 test suite,
w/ -std=c++20 -O1:

namespace std {
template <typename T>
struct remove_reference {
  using type = T;
};

template <typename T>
constexpr typename std::remove_reference<T>::type &&
move (T &&t) noexcept
{
  return static_cast<typename std::remove_reference<T>::type &&> (t);
}
}

consteval int
f_eval ()
{
  return 0;
}

struct Copy {
  int (*ptr) ();

  constexpr Copy (int (*p) () = nullptr) : ptr (p)
  {
  }
};

Copy *
test ()
{
  return new Copy (std::move (Copy (&f_eval)));
}

% g++-13 -std=c++20 -O1 -c rc4hkfes.cpp
rc4hkfes.cpp: In function 'Copy* test()':
rc4hkfes.cpp:32:37: error: taking address of an immediate function 'consteval
int f_eval()'
   32 |   return new Copy (std::move (Copy (&f_eval)));
      |                                     ^~~~~~~
rc4hkfes.cpp:32:46: internal compiler error: in cp_gimplify_init_expr, at
cp/cp-gimplify.cc:253
   32 |   return new Copy (std::move (Copy (&f_eval)));
      |                                              ^
0x6adbf7 cp_gimplify_init_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/cp/cp-gimplify.cc:253
0x9eb5f7 cp_gimplify_expr(tree_node**, gimple**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/cp/cp-gimplify.cc:508
0xef9cce gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16237
0xf0c527 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xf0c527 gimplify_compound_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6380
0xf0c5c9 gimplify_compound_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6378
0xf0db89 gimplify_modify_expr_rhs
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:5682
0xf0e316 gimplify_modify_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6076
0xefa661 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16328
0xefcf96 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xf0b4fd gimplify_and_add(tree_node*, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:492
0xf0b4fd gimplify_return_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:1680
0xefae1a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16590
0xefcf96 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xefe7cc gimplify_cleanup_point_expr
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:6928
0xefb1e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:16721
0xf1dfe2 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:7187
0xf1dfe2 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:17588
0xf1e46a gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/gimplify.cc:17787
0xd39a97 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221009/work/gcc-13-20221009/gcc/cgraphunit.cc:676

I suspect it can be a duplicate of PR107198, though.

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

* [Bug c++/107218] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
  2022-10-11 17:00 [Bug c++/107218] New: [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 asolokha at gmx dot com
@ 2022-10-12  7:51 ` marxin at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-12  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with the same revision as PR107198.

*** This bug has been marked as a duplicate of bug 107198 ***

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

end of thread, other threads:[~2022-10-12  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 17:00 [Bug c++/107218] New: [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 asolokha at gmx dot com
2022-10-12  7:51 ` [Bug c++/107218] " marxin 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).