public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113966] New: Internal compiler error in `do_auto_deduction`
@ 2024-02-17  7:59 mateusz.pusz at gmail dot com
  2024-02-17  8:16 ` [Bug c++/113966] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mateusz.pusz at gmail dot com @ 2024-02-17  7:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113966
           Summary: Internal compiler error in `do_auto_deduction`
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mateusz.pusz at gmail dot com
  Target Milestone: ---

The following ICE has been happening for a longer time now for
https://godbolt.org/z/7EK64PPr6:

```
quantity.h:316:9: internal compiler error: in do_auto_deduction, at
cp/pt.cc:31135
  315 |       {
      |       ~  
  316 |         a += b
      |         ^~~~~~
  317 |       } -> std::same_as<rep&>;
      |       ~~~~~~~~~~~~~~~~~~~~~~~
0x264d1cc internal_error(char const*, ...)
        ???:0
0xa526c5 fancy_abort(char const*, int, char const*)
        ???:0
0xad5976 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xacf547 maybe_substitute_reqs_for(tree_node*, tree_node const*)
        ???:0
0xcb4d66 instantiate_class_template(tree_node*)
        ???:0
0xd0b594 complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        ???:0
0xd0b6ac require_complete_type(tree_node*, int)
        ???:0
0xa6d24d build_cxx_call(tree_node*, int, tree_node**, int, tree_node*)
        ???:0
0xa87af8 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
        ???:0
0xd0e002 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
        ???:0
0xc555aa c_parse_file()
        ???:0
0xda9739 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

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

* [Bug c++/113966] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
@ 2024-02-17  8:16 ` pinskia at gcc dot gnu.org
  2024-02-17  8:16 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-17  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57444
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57444&action=edit
Preprocessed source

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

* [Bug c++/113966] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
  2024-02-17  8:16 ` [Bug c++/113966] " pinskia at gcc dot gnu.org
@ 2024-02-17  8:16 ` pinskia at gcc dot gnu.org
  2024-02-17  8:26 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-17  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note next time also attach the preprocessed source.

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

* [Bug c++/113966] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
  2024-02-17  8:16 ` [Bug c++/113966] " pinskia at gcc dot gnu.org
  2024-02-17  8:16 ` pinskia at gcc dot gnu.org
@ 2024-02-17  8:26 ` pinskia at gcc dot gnu.org
  2024-02-17 15:05 ` [Bug c++/113966] [14 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-17  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reducing ...

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (2 preceding siblings ...)
  2024-02-17  8:26 ` pinskia at gcc dot gnu.org
@ 2024-02-17 15:05 ` mpolacek at gcc dot gnu.org
  2024-02-17 15:13 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-17 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|Internal compiler error in  |[14 Regression] Internal
                   |`do_auto_deduction`         |compiler error in
                   |                            |`do_auto_deduction`
   Target Milestone|---                         |14.0
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
   Last reconfirmed|                            |2024-02-17
           Priority|P3                          |P1

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started to ICE with r14-8770:

commit 686b5eb9c9ee623a604dde5c49fa11c23f384c62
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Feb 2 19:07:08 2024 -0500

    c++: requires-exprs and partial constraint subst [PR110006]

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (3 preceding siblings ...)
  2024-02-17 15:05 ` [Bug c++/113966] [14 Regression] " mpolacek at gcc dot gnu.org
@ 2024-02-17 15:13 ` mpolacek at gcc dot gnu.org
  2024-02-17 18:17 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-17 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
  /* Check any placeholder constraints against the deduced type. */
  if (processing_template_decl && context == adc_unify)
    /* Constraints will be checked after deduction.  */;
  else if (tree constr = NON_ERROR (PLACEHOLDER_TYPE_CONSTRAINTS (auto_node)))
    {
      if (processing_template_decl)
        {
          gcc_checking_assert (context == adc_variable_type
                               || context == adc_return_type
                               || context == adc_decomp_type);

(gdb) p context
$2 = adc_requirement

Maybe we just have to allow adc_requirement in the assert?

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (4 preceding siblings ...)
  2024-02-17 15:13 ` mpolacek at gcc dot gnu.org
@ 2024-02-17 18:17 ` pinskia at gcc dot gnu.org
  2024-02-17 19:02 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-17 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57452
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57452&action=edit
semi reduced testcase

Reduced somewhat. There is some more to go but I will leave that for someone
else. Some concepts can be removed still but it looks like that has to be done
manually.

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (5 preceding siblings ...)
  2024-02-17 18:17 ` pinskia at gcc dot gnu.org
@ 2024-02-17 19:02 ` ppalka at gcc dot gnu.org
  2024-02-19 16:35 ` cvs-commit at gcc dot gnu.org
  2024-02-19 16:35 ` ppalka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-02-17 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org

--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
template<class T> concept C = T::value;

template<class T>
struct A {
  template<class U> requires requires { { T() } -> C; }
  friend void f(A) { }
};

template struct A<int>;

We probably don't want to do do_auto_deduction at all during partial
substitution, since that could cause requirements to get checked out of order.

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (6 preceding siblings ...)
  2024-02-17 19:02 ` ppalka at gcc dot gnu.org
@ 2024-02-19 16:35 ` cvs-commit at gcc dot gnu.org
  2024-02-19 16:35 ` ppalka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-19 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:3a6f3354eaaf38b5e6be41e4ebf521d299593a6e

commit r14-9066-g3a6f3354eaaf38b5e6be41e4ebf521d299593a6e
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Feb 19 11:34:45 2024 -0500

    c++: compound-requirement partial substitution [PR113966]

    When partially substituting a requires-expr, we don't want to perform
    any additional checks beyond the substitution itself so as to minimize
    checking requirements out of order.  So don't check the return-type-req
    of a compound-requirement during partial substitution.  And don't check
    the noexcept condition either since we can't do that on templated trees.

            PR c++/113966

    gcc/cp/ChangeLog:

            * constraint.cc (tsubst_compound_requirement): Don't check
            the noexcept condition or the return-type-requirement when
            partially substituting.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-friend17.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>

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

* [Bug c++/113966] [14 Regression] Internal compiler error in `do_auto_deduction`
  2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
                   ` (7 preceding siblings ...)
  2024-02-19 16:35 ` cvs-commit at gcc dot gnu.org
@ 2024-02-19 16:35 ` ppalka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-02-19 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
           Keywords|needs-reduction             |
         Resolution|---                         |FIXED

--- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-02-19 16:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17  7:59 [Bug c++/113966] New: Internal compiler error in `do_auto_deduction` mateusz.pusz at gmail dot com
2024-02-17  8:16 ` [Bug c++/113966] " pinskia at gcc dot gnu.org
2024-02-17  8:16 ` pinskia at gcc dot gnu.org
2024-02-17  8:26 ` pinskia at gcc dot gnu.org
2024-02-17 15:05 ` [Bug c++/113966] [14 Regression] " mpolacek at gcc dot gnu.org
2024-02-17 15:13 ` mpolacek at gcc dot gnu.org
2024-02-17 18:17 ` pinskia at gcc dot gnu.org
2024-02-17 19:02 ` ppalka at gcc dot gnu.org
2024-02-19 16:35 ` cvs-commit at gcc dot gnu.org
2024-02-19 16:35 ` ppalka 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).