public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error
@ 2021-03-30 17:17 nickgray0 at brown dot edu
  2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: nickgray0 at brown dot edu @ 2021-03-30 17:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99833
           Summary: structured binding + if init + generic lambda =
                    internal compiler error
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickgray0 at brown dot edu
  Target Milestone: ---
             Build: -std=c++20

as the title suggests, the following code triggers an internal compiler error:

    #include <tuple>

    auto f(auto&& x) {
        [&](auto...) {
            auto y = std::tuple{ "what's happening here?", x };
            if constexpr (auto [_, z] = y; requires { z; })
                return;
        }();
    }

    auto main()->int {
        f(42);
    }

error message: <source>:6:36: internal compiler error: in tsubst_decomp_names,
at cp/pt.c:18034
    6 |                 if constexpr (auto [_, z] = y; requires { z; })
      |                                    ^~~~~~
0x1cfb6a9 internal_error(char const*, ...)
        ???:0
0x6ba871 fancy_abort(char const*, int, char const*)
        ???:0
0x91c84f instantiate_decl(tree_node*, bool, bool)
        ???:0
0x7c6c0e maybe_instantiate_decl(tree_node*)
        ???:0
0x7c8370 mark_used(tree_node*, int)
        ???:0
0x6e2835 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0x980ae5 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0x91c84f instantiate_decl(tree_node*, bool, bool)
        ???:0
0x7c6c0e maybe_instantiate_decl(tree_node*)
        ???:0
0x7c8370 mark_used(tree_node*, int)
        ???:0
0x6de097 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0x980c6c finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0x8e12ad c_parse_file()
        ???:0
0xa600a2 c_common_parse_file()
        ???:0


either moving the structured binding outside of if statement or making the
lambda non-generic seems to solve the problem.

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
@ 2021-03-30 20:24 ` mpolacek at gcc dot gnu.org
  2021-03-30 20:57 ` mpolacek at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-30 20:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-03-30
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |8.5
             Status|UNCONFIRMED                 |NEW
            Summary|structured binding + if     |[8/9/10/11 Regression]
                   |init + generic lambda =     |structured binding + if
                   |internal compiler error     |init + generic lambda =
                   |                            |internal compiler error
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

$ xg++-7 -c 99833.C -std=c++17 -fconcepts
# ok
$ xg++-8 -c 99833.C -std=c++17 -fconcepts
99833.C: In instantiation of ‘f(auto:1&&) [with auto:1 = int]::<lambda(auto:2
...)> [with auto:2 = {}]’:
99833.C:8:10:   required from ‘auto f(auto:1&&) [with auto:1 = int]’
99833.C:12:13:   required from here
99833.C:6:32: internal compiler error: in tsubst_decomp_names, at cp/pt.c:16673
             if constexpr (auto [_, z] = y; requires { z; })
                                ^~~~~~
0xa44cc6 tsubst_decomp_names
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16673
0xa46041 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16837
0xa4b103 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:17512
0xa46e75 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16961
0xa45012 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16714
0xa475be tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:17014
0xa475be tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:17014
0xa45012 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16714
0xa475be tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:17014
0xa68a40 instantiate_decl(tree_node*, bool, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:24161
0x90b1e3 maybe_instantiate_decl
        /home/mpolacek/src/gcc8/gcc/cp/decl2.c:5211
0x90bb8a mark_used(tree_node*, int)
        /home/mpolacek/src/gcc8/gcc/cp/decl2.c:5312
0x814c71 build_over_call
        /home/mpolacek/src/gcc8/gcc/cp/call.c:8286
0x804e91 build_op_call_1
        /home/mpolacek/src/gcc8/gcc/cp/call.c:4589
0x805053 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        /home/mpolacek/src/gcc8/gcc/cp/call.c:4618
0xa9a847 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        /home/mpolacek/src/gcc8/gcc/cp/semantics.c:2567
0xa503bf tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:18594
0xa4b422 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:17530
0xa4512d tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16728
0xa45012 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc8/gcc/cp/pt.c:16714

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
  2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2021-03-30 20:57 ` mpolacek at gcc dot gnu.org
  2021-03-30 20:58 ` mpolacek at gcc dot gnu.org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-30 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Build|-std=c++20                  |
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r11-372.  So may be a P1 :(.

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
  2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
  2021-03-30 20:57 ` mpolacek at gcc dot gnu.org
@ 2021-03-30 20:58 ` mpolacek at gcc dot gnu.org
  2021-03-30 21:28 ` ppalka at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-30 20:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced:

namespace std {
template <int __v> struct integral_constant {
  static constexpr int value = __v;
};
template <typename> struct tuple_size;
template <unsigned long, typename> struct tuple_element;
template <long __i, typename _Tp>
using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
template <typename...> class tuple;
template <typename... _UTypes> tuple(_UTypes...) -> tuple<_UTypes...>;
template <typename _T1, typename _T2> class tuple<_T1, _T2> {
public:
  template <typename _U1, typename _U2> tuple(_U1, _U2);
};
template <typename... _Elements>
struct tuple_size<tuple<_Elements...>>
    : integral_constant<sizeof...(_Elements)> {};
template <unsigned long __i, typename _Head, typename... _Tail>
struct tuple_element<__i, tuple<_Head, _Tail...>>
    : tuple_element<__i - 1, tuple<_Tail...>> {};
template <typename _Head, typename... _Tail>
struct tuple_element<0, tuple<_Head, _Tail...>> {
  typedef _Head type;
};
template <long __i, typename... _Elements>
__tuple_element_t<__i, tuple<_Elements...>> get(tuple<_Elements...>);
} // namespace std
void f(auto x) {
  [&](auto...) {
    auto y = std::tuple{"", x};
    if constexpr (auto [_, z] = y; requires { z; })
      ;
  }();
}
auto main() -> int { f(2); }

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (2 preceding siblings ...)
  2021-03-30 20:58 ` mpolacek at gcc dot gnu.org
@ 2021-03-30 21:28 ` ppalka at gcc dot gnu.org
  2021-03-31  7:56 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-03-30 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (3 preceding siblings ...)
  2021-03-30 21:28 ` ppalka at gcc dot gnu.org
@ 2021-03-31  7:56 ` rguenth at gcc dot gnu.org
  2021-03-31 17:24 ` ppalka at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-31  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> Started with r11-372.  So may be a P1 :(.

But you show GCC 8 has the same issue ...

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (4 preceding siblings ...)
  2021-03-31  7:56 ` rguenth at gcc dot gnu.org
@ 2021-03-31 17:24 ` ppalka at gcc dot gnu.org
  2021-04-14  9:40 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-03-31 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
It looks like GCC 10.1 accepts this testcase, and 10.2, 10.3 and 11 reject.

The requires-expression is a red herring, we can trigger the ICE without it:

#include <tuple>
template<class> void f() {
  [] (auto x) {
    if constexpr (auto [a, b] = std::tuple{x, x}; sizeof(a) > 1)
      ;
  }(0);
}

template void f<int>();

The ICE for this one isn't a regression it seems.

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (5 preceding siblings ...)
  2021-03-31 17:24 ` ppalka at gcc dot gnu.org
@ 2021-04-14  9:40 ` jakub at gcc dot gnu.org
  2021-04-14  9:54 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-14  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That reduced:
template <class>
void
foo ()
{
  [](auto d) { if constexpr (auto [a, b]{d}; a) ; } (0);
}
template void foo<int> ();

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (6 preceding siblings ...)
  2021-04-14  9:40 ` jakub at gcc dot gnu.org
@ 2021-04-14  9:54 ` jakub at gcc dot gnu.org
  2021-04-14 10:36 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-14  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And hopefully valid variant thereof:
struct S { int a, b; };
template <class>
void
foo ()
{
  [](auto d) { if constexpr (auto [a, b]{d}; sizeof (a) > 0) a++; } (S{});
}
template void foo<S> ();

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (7 preceding siblings ...)
  2021-04-14  9:54 ` jakub at gcc dot gnu.org
@ 2021-04-14 10:36 ` jakub at gcc dot gnu.org
  2021-04-14 11:14 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-14 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And that ICEs since r7-4511-g70f40fea6a317d7be82d1f02defb59381c7752e7 when
structured binding support has been added, first with
internal compiler error: in is_normal_capture_proxy, at cp/lambda.c:271
then is accepted since r8-6835-g6f58bc5825c0d0ff0606b747b01bb2dcff882a1d
and then since r8-7613-g1456e764105702a0bb6c9be13d8eef7f21990a79 ICEs in
tsubst_decomp_names.

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (8 preceding siblings ...)
  2021-04-14 10:36 ` jakub at gcc dot gnu.org
@ 2021-04-14 11:14 ` jakub at gcc dot gnu.org
  2021-04-14 12:25 ` ppalka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-14 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50591
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50591&action=edit
gcc11-pr99833.patch

Untested fix.  This seems to work for me...

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (9 preceding siblings ...)
  2021-04-14 11:14 ` jakub at gcc dot gnu.org
@ 2021-04-14 12:25 ` ppalka at gcc dot gnu.org
  2021-04-16  7:33 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-04-14 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #9)
> Created attachment 50591 [details]
> gcc11-pr99833.patch
> 
> Untested fix.  This seems to work for me...

Ah, I hadn't considered that the problem might be in extract_locals_spec. 
You're much farther than I am on this PR :)  Please feel free to take it.

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

* [Bug c++/99833] [8/9/10/11 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (10 preceding siblings ...)
  2021-04-14 12:25 ` ppalka at gcc dot gnu.org
@ 2021-04-16  7:33 ` cvs-commit at gcc dot gnu.org
  2021-04-16  7:35 ` [Bug c++/99833] [8/9/10 " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-16  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:20eb7a1891cfd7fa85295a236cebe0322d041edd

commit r11-8209-g20eb7a1891cfd7fa85295a236cebe0322d041edd
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 16 09:32:44 2021 +0200

    c++: Fix up handling of structured bindings in extract_locals_r [PR99833]

    The following testcase ICEs in tsubst_decomp_names because the assumptions
    that the structured binding artificial var is followed in DECL_CHAIN by
    the corresponding structured binding vars is violated.
    I've tracked it to extract_locals* which is done for the constexpr
    IF_STMT.  extract_locals_r when it sees a DECL_EXPR adds that decl
    into a hash set so that such decls aren't returned from extract_locals*,
    but in the case of a structured binding that just means the artificial var
    and not the vars corresponding to structured binding identifiers.
    The following patch fixes it by pushing not just the artificial var
    for structured bindings but also the other vars.

    2021-04-16  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99833
            * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
            binding, add to data.internal also all corresponding structured
            binding decls.

            * g++.dg/cpp1z/pr99833.C: New test.
            * g++.dg/cpp2a/pr99833.C: New test.

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

* [Bug c++/99833] [8/9/10 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (11 preceding siblings ...)
  2021-04-16  7:33 ` cvs-commit at gcc dot gnu.org
@ 2021-04-16  7:35 ` jakub at gcc dot gnu.org
  2021-04-20  9:46 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-16  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10/11 Regression]      |[8/9/10 Regression]
                   |structured binding + if     |structured binding + if
                   |init + generic lambda =     |init + generic lambda =
                   |internal compiler error     |internal compiler error

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

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

* [Bug c++/99833] [8/9/10 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (12 preceding siblings ...)
  2021-04-16  7:35 ` [Bug c++/99833] [8/9/10 " jakub at gcc dot gnu.org
@ 2021-04-20  9:46 ` cvs-commit at gcc dot gnu.org
  2021-04-20  9:53 ` [Bug c++/99833] [8/9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:06d50ebc9fb2761ed2bdda5e76adb4d47a8ca983

commit r10-9728-g06d50ebc9fb2761ed2bdda5e76adb4d47a8ca983
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 16 09:32:44 2021 +0200

    c++: Fix up handling of structured bindings in extract_locals_r [PR99833]

    The following testcase ICEs in tsubst_decomp_names because the assumptions
    that the structured binding artificial var is followed in DECL_CHAIN by
    the corresponding structured binding vars is violated.
    I've tracked it to extract_locals* which is done for the constexpr
    IF_STMT.  extract_locals_r when it sees a DECL_EXPR adds that decl
    into a hash set so that such decls aren't returned from extract_locals*,
    but in the case of a structured binding that just means the artificial var
    and not the vars corresponding to structured binding identifiers.
    The following patch fixes it by pushing not just the artificial var
    for structured bindings but also the other vars.

    2021-04-16  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99833
            * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
            binding, add to data.internal also all corresponding structured
            binding decls.

            * g++.dg/cpp1z/pr99833.C: New test.
            * g++.dg/cpp2a/pr99833.C: New test.

    (cherry picked from commit 20eb7a1891cfd7fa85295a236cebe0322d041edd)

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

* [Bug c++/99833] [8/9 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (13 preceding siblings ...)
  2021-04-20  9:46 ` cvs-commit at gcc dot gnu.org
@ 2021-04-20  9:53 ` jakub at gcc dot gnu.org
  2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-20  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10 Regression]         |[8/9 Regression] structured
                   |structured binding + if     |binding + if init + generic
                   |init + generic lambda =     |lambda = internal compiler
                   |internal compiler error     |error

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.4 too.

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

* [Bug c++/99833] [8/9 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (14 preceding siblings ...)
  2021-04-20  9:53 ` [Bug c++/99833] [8/9 " jakub at gcc dot gnu.org
@ 2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
  2021-04-22 16:53 ` cvs-commit at gcc dot gnu.org
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20 23:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:969999f7b35903338738c7e7e4d99aa929276404

commit r9-9447-g969999f7b35903338738c7e7e4d99aa929276404
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 16 09:32:44 2021 +0200

    c++: Fix up handling of structured bindings in extract_locals_r [PR99833]

    The following testcase ICEs in tsubst_decomp_names because the assumptions
    that the structured binding artificial var is followed in DECL_CHAIN by
    the corresponding structured binding vars is violated.
    I've tracked it to extract_locals* which is done for the constexpr
    IF_STMT.  extract_locals_r when it sees a DECL_EXPR adds that decl
    into a hash set so that such decls aren't returned from extract_locals*,
    but in the case of a structured binding that just means the artificial var
    and not the vars corresponding to structured binding identifiers.
    The following patch fixes it by pushing not just the artificial var
    for structured bindings but also the other vars.

    2021-04-16  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99833
            * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
            binding, add to data.internal also all corresponding structured
            binding decls.

            * g++.dg/cpp1z/pr99833.C: New test.

    (cherry picked from commit 06d50ebc9fb2761ed2bdda5e76adb4d47a8ca983)

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

* [Bug c++/99833] [8/9 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (15 preceding siblings ...)
  2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 16:53 ` cvs-commit at gcc dot gnu.org
  2021-04-22 17:11 ` jakub at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:7285512d782ded76d1b0d0d164fdc1c5ab7e9fe0

commit r8-10910-g7285512d782ded76d1b0d0d164fdc1c5ab7e9fe0
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 16 09:32:44 2021 +0200

    c++: Fix up handling of structured bindings in extract_locals_r [PR99833]

    The following testcase ICEs in tsubst_decomp_names because the assumptions
    that the structured binding artificial var is followed in DECL_CHAIN by
    the corresponding structured binding vars is violated.
    I've tracked it to extract_locals* which is done for the constexpr
    IF_STMT.  extract_locals_r when it sees a DECL_EXPR adds that decl
    into a hash set so that such decls aren't returned from extract_locals*,
    but in the case of a structured binding that just means the artificial var
    and not the vars corresponding to structured binding identifiers.
    The following patch fixes it by pushing not just the artificial var
    for structured bindings but also the other vars.

    2021-04-16  Jakub Jelinek  <jakub@redhat.com>

            PR c++/99833
            * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
            binding, add to data.internal also all corresponding structured
            binding decls.

            * g++.dg/cpp1z/pr99833.C: New test.

    (cherry picked from commit 06d50ebc9fb2761ed2bdda5e76adb4d47a8ca983)

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

* [Bug c++/99833] [8/9 Regression] structured binding + if init + generic lambda = internal compiler error
  2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
                   ` (16 preceding siblings ...)
  2021-04-22 16:53 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 17:11 ` jakub at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-22 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-04-22 17:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 17:17 [Bug c++/99833] New: structured binding + if init + generic lambda = internal compiler error nickgray0 at brown dot edu
2021-03-30 20:24 ` [Bug c++/99833] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2021-03-30 20:57 ` mpolacek at gcc dot gnu.org
2021-03-30 20:58 ` mpolacek at gcc dot gnu.org
2021-03-30 21:28 ` ppalka at gcc dot gnu.org
2021-03-31  7:56 ` rguenth at gcc dot gnu.org
2021-03-31 17:24 ` ppalka at gcc dot gnu.org
2021-04-14  9:40 ` jakub at gcc dot gnu.org
2021-04-14  9:54 ` jakub at gcc dot gnu.org
2021-04-14 10:36 ` jakub at gcc dot gnu.org
2021-04-14 11:14 ` jakub at gcc dot gnu.org
2021-04-14 12:25 ` ppalka at gcc dot gnu.org
2021-04-16  7:33 ` cvs-commit at gcc dot gnu.org
2021-04-16  7:35 ` [Bug c++/99833] [8/9/10 " jakub at gcc dot gnu.org
2021-04-20  9:46 ` cvs-commit at gcc dot gnu.org
2021-04-20  9:53 ` [Bug c++/99833] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:34 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:53 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub 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).