public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102724] New: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089
@ 2021-10-13  7:58 asolokha at gmx dot com
  2021-10-13 12:16 ` [Bug c++/102724] " marxin at gcc dot gnu.org
  2023-07-19  2:18 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: asolokha at gmx dot com @ 2021-10-13  7:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102724
           Summary: [11/12 Regression] ICE in genericize_spaceship, at
                    cp/method.c:1089
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: error-recovery, 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++-12.0.0-alpha20211010 snapshot (g:74ccca380cde5e79e082d39214b306a90ded0344)
ICEs when compiling the following testcase, reduced from
test/CXX/class/class.compare/class.spaceship/p1.cpp from the clang 12.0.0 test
suite, w/ -std=c++20:

namespace std {
  struct strong_ordering {
    int n;
    constexpr operator int() const { return n; }
    static const strong_ordering less, equal, greater;
  };
  constexpr strong_ordering strong_ordering::less{-1},
      strong_ordering::equal{0}, strong_ordering::greater{1};
}

namespace Synthesis {
  enum Result { False, True, Mu };

  constexpr bool toBool(Result R) { return R == True; }

  struct Val {
    Result equal, less;
    constexpr bool operator==(const Val&) const { return toBool(equal); }
    constexpr bool operator<(const Val&) const { return toBool(less); }
  };

  template<typename T> struct Cmp {
    Val val;
    friend T operator<=>(const Cmp&, const Cmp&) = default;
  };

  struct custom_ordering {
    custom_ordering(std::strong_ordering o);
  };
  void f(Cmp<custom_ordering> c) {
    c <=> c;
  }
}

% g++-12.0.0 -std=c++20 -c mfri5bsa.cpp
mfri5bsa.cpp: In function 'void
Synthesis::f(Synthesis::Cmp<Synthesis::custom_ordering>)':
mfri5bsa.cpp:31:11: error: use of deleted function 'constexpr
Synthesis::custom_ordering Synthesis::operator<=>(const
Synthesis::Cmp<Synthesis::custom_ordering>&, const
Synthesis::Cmp<Synthesis::custom_ordering>&)'
   31 |     c <=> c;
      |           ^
mfri5bsa.cpp:24:14: note: 'constexpr Synthesis::custom_ordering
Synthesis::operator<=>(const Synthesis::Cmp<Synthesis::custom_ordering>&, const
Synthesis::Cmp<Synthesis::custom_ordering>&)' is implicitly deleted because the
default definition would be ill-formed:
   24 |     friend T operator<=>(const Cmp&, const Cmp&) = default;
      |              ^~~~~~~~
mfri5bsa.cpp:23:9: error: no match for 'operator<=>' (operand types are
'Synthesis::Val' and 'Synthesis::Val')
   23 |     Val val;
      |         ^~~
mfri5bsa.cpp:24:14: internal compiler error: in genericize_spaceship, at
cp/method.c:1089
   24 |     friend T operator<=>(const Cmp&, const Cmp&) = default;
      |              ^~~~~~~~
0x6ba1ae genericize_spaceship(unsigned int, tree_node*, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/method.c:1089
0xa3d849 do_one_comp
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/method.c:1388
0xa3e2de build_comparison_op(tree_node*, bool, int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/method.c:1595
0xa45d4e maybe_explain_implicit_delete(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/method.c:2822
0x9f7d7c mark_used(tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/decl2.c:5703
0x93e0a6 build_over_call
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/call.c:9721
0x9449f2 build_new_op_1
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/call.c:6711
0x9450cd build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/call.c:6970
0xb939cd build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/typeck.c:4483
0xaa3ec7 cp_parser_binary_expression
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:10073
0xaa469d cp_parser_assignment_expression
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:10211
0xaa6162 cp_parser_expression
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:10381
0xaa99f8 cp_parser_expression_statement
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:12574
0xab6ff9 cp_parser_statement
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:12370
0xab80bd cp_parser_statement_seq_opt
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:12722
0xab8198 cp_parser_compound_statement
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:12671
0xad9138 cp_parser_function_body
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:24904
0xad9138 cp_parser_ctor_initializer_opt_and_function_body
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:24955
0xad9eba cp_parser_function_definition_after_declarator
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:31085
0xadb22b cp_parser_function_definition_from_specifiers_and_declarator
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gcc/cp/parser.c:31001

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

* [Bug c++/102724] ICE in genericize_spaceship, at cp/method.c:1089
  2021-10-13  7:58 [Bug c++/102724] New: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089 asolokha at gmx dot com
@ 2021-10-13 12:16 ` marxin at gcc dot gnu.org
  2023-07-19  2:18 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-13 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-5866-g4ed1dc1275bba89a.

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

* [Bug c++/102724] ICE in genericize_spaceship, at cp/method.c:1089
  2021-10-13  7:58 [Bug c++/102724] New: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089 asolokha at gmx dot com
  2021-10-13 12:16 ` [Bug c++/102724] " marxin at gcc dot gnu.org
@ 2023-07-19  2:18 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-19  2:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-07-19

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2023-07-19  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  7:58 [Bug c++/102724] New: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089 asolokha at gmx dot com
2021-10-13 12:16 ` [Bug c++/102724] " marxin at gcc dot gnu.org
2023-07-19  2:18 ` pinskia 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).