public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08
@ 2020-12-18 12:33 marxin at gcc dot gnu.org
  2020-12-18 12:33 ` [Bug c++/98372] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-18 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98372
           Summary: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1
                    elts in tsubst, at cp/pt.c:15500 since
                    r11-5942-g059da609fa8b3a08
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: nathan at gcc dot gnu.org
  Target Milestone: ---

Reduced from libcamera package:

$ cat ipa-key.ii
template <typename _Tp> using remove_pointer_t = typename _Tp ::type;
template <bool> struct enable_if;
template <bool _Cond, typename>
using enable_if_t = typename enable_if<_Cond>::type;
template <typename> bool is_convertible_v;
template <typename, unsigned long = 0> class Span;
template <typename T, unsigned long> class Span {
  using element_type = T;
  template <unsigned long N>
  Span(element_type (&arr)[N],
       enable_if_t<is_convertible_v<remove_pointer_t<decltype(data(arr))>>,
                   decltype(nullptr)>);
};
template <typename T> class Span<T> {
  using element_type = T;
  template <unsigned long N>
  Span(element_type (&arr)[N],
       enable_if_t<is_convertible_v<remove_pointer_t<decltype(data(arr))>>,
                   decltype(nullptr)>);
};

struct aaa
{
  Span<char> data0;
};

$ g++ ipa-key.ii -c
ipa-key.ii: In instantiation of ‘class Span<char>’:
ipa-key.ii:24:14:   required from here
ipa-key.ii:10:23: internal compiler error: tree check: accessed elt 2 of
‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15511
   10 |   Span(element_type (&arr)[N],
      |        ~~~~~~~~~~~~~~~^~~~~~~
0x83963e tree_vec_elt_check_failed(int, int, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.c:10011
0x94f182 tree_vec_elt_check(tree_node*, int, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3559
0xad3dae tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15511
0xab7c28 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:20744
0xac10d8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:19004
0xad5a83 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12247
0xad5a83 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12258
0xad5a83 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12246
0xad5b98 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:13316
0xad4c57 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15395
0xad2d14 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15434
0xad2d14 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15434
0xabe8ef tsubst_decl
        /home/marxin/Programming/gcc/gcc/cp/pt.c:14461
0xab479f tsubst_copy
        /home/marxin/Programming/gcc/gcc/cp/pt.c:16514
0xab5f50 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:20609
0xab6703 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:19526
0xab6a03 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:20033
0xad31ea tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:16086
0xad3296 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15979
0xad5b98 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:13316
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c++/98372] ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08
  2020-12-18 12:33 [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08 marxin at gcc dot gnu.org
@ 2020-12-18 12:33 ` marxin at gcc dot gnu.org
  2021-01-05 13:34 ` [Bug c++/98372] [11 Regression] " nathan at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-18 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-12-18
      Known to work|                            |10.2.0
      Known to fail|                            |11.0
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P1

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

* [Bug c++/98372] [11 Regression] ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08
  2020-12-18 12:33 [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08 marxin at gcc dot gnu.org
  2020-12-18 12:33 ` [Bug c++/98372] " marxin at gcc dot gnu.org
@ 2021-01-05 13:34 ` nathan at gcc dot gnu.org
  2021-01-14 13:31 ` cvs-commit at gcc dot gnu.org
  2021-01-14 13:32 ` nathan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-01-05 13:34 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

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

* [Bug c++/98372] [11 Regression] ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08
  2020-12-18 12:33 [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08 marxin at gcc dot gnu.org
  2020-12-18 12:33 ` [Bug c++/98372] " marxin at gcc dot gnu.org
  2021-01-05 13:34 ` [Bug c++/98372] [11 Regression] " nathan at gcc dot gnu.org
@ 2021-01-14 13:31 ` cvs-commit at gcc dot gnu.org
  2021-01-14 13:32 ` nathan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-14 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>:

https://gcc.gnu.org/g:d61d2a5f3ce9238bad7cbd7733d90c6ec7ae5fbc

commit r11-6666-gd61d2a5f3ce9238bad7cbd7733d90c6ec7ae5fbc
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Jan 14 05:15:33 2021 -0800

    c++: Fix erroneous parm comparison logic [PR 98372]

    I flubbed an application of De Morgan's law.  Let's just express the
    logic directly and let the compiler figure it out.  This bug made it
    look like pr52830 was fixed, but it is not.

            PR c++/98372
            gcc/cp/
            * tree.c (cp_tree_equal): Correct map_context logic.
            gcc/testsuite/
            * g++.dg/cpp0x/constexpr-52830.C: Restore dg-ice
            * g++.dg/template/pr98372.C: New.

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

* [Bug c++/98372] [11 Regression] ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08
  2020-12-18 12:33 [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-01-14 13:31 ` cvs-commit at gcc dot gnu.org
@ 2021-01-14 13:32 ` nathan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-01-14 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
fixed: * d61d2a5f3ce 2021-01-14 | c++: Fix erroneous parm comparison logic [PR
98372]

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

end of thread, other threads:[~2021-01-14 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 12:33 [Bug c++/98372] New: ICE tree check: accessed elt 2 of ‘tree_vec’ with 1 elts in tsubst, at cp/pt.c:15500 since r11-5942-g059da609fa8b3a08 marxin at gcc dot gnu.org
2020-12-18 12:33 ` [Bug c++/98372] " marxin at gcc dot gnu.org
2021-01-05 13:34 ` [Bug c++/98372] [11 Regression] " nathan at gcc dot gnu.org
2021-01-14 13:31 ` cvs-commit at gcc dot gnu.org
2021-01-14 13:32 ` nathan 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).