public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
@ 2020-12-03  9:31 marxin at gcc dot gnu.org
  2020-12-03  9:31 ` [Bug c++/98116] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-03  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98116
           Summary: [11 Regression] ICE in strip_typedefs, at
                    cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
           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: ---

The following is reduced from chromium:

$ cat file_path.ii
namespace std {
struct is_convertible;
template <typename _Tp> using remove_pointer_t = typename _Tp ::type;
template <bool> struct enable_if;
template <typename> void declval();
template <bool _Cond> using enable_if_t = typename enable_if<_Cond>::type;
template <typename, typename> class Trans_NS___cxx11_basic_string {
  long _M_string_length;
};
} // namespace std
struct string16_char_traits;
template class std::Trans_NS___cxx11_basic_string<unsigned short,
                                                  string16_char_traits>;
template <typename, typename> using IsLegalDataConversion =
std::is_convertible;
template <typename Container, typename T>
using ContainerHasConvertibleData = IsLegalDataConversion<
    std::remove_pointer_t<decltype(std::declval<Container>)>, T>;
template <typename Array, typename T, long>
using EnableIfSpanCompatibleArray =
    std::enable_if_t<ContainerHasConvertibleData<Array, T>::value>;
template <int Extent> class span {
  template <long N, EnableIfSpanCompatibleArray<
                        const std::Trans_NS___cxx11_basic_string<
                            unsigned short, string16_char_traits>[N],
                        std::Trans_NS___cxx11_basic_string<short, int>,
Extent>>
  span();
};

$ g++ file_path.ii -c
file_path.ii:25:73: internal compiler error: in strip_typedefs, at
cp/tree.c:1744
   25 |                         std::Trans_NS___cxx11_basic_string<short, int>,
Extent>>
      |                                                                        
^~~~~~
0x6dd571 strip_typedefs(tree_node*, bool*, unsigned int)
        /home/marxin/Programming/gcc/gcc/cp/tree.c:1744
0xa3cbb2 canonicalize_type_argument(tree_node*, int)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:8121
0xa3cbb2 canonicalize_type_argument(tree_node*, int)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:8116
0xa74cf3 coerce_template_parms
        /home/marxin/Programming/gcc/gcc/cp/pt.c:8965
0xa6e496 instantiate_alias_template
        /home/marxin/Programming/gcc/gcc/cp/pt.c:20991
0xa6e496 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15322
0xa7816e lookup_template_class_1
        /home/marxin/Programming/gcc/gcc/cp/pt.c:9907
0xa7964c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:10190
0xaa063b finish_template_type(tree_node*, tree_node*, int)
        /home/marxin/Programming/gcc/gcc/cp/semantics.c:3442
0xa18b11 cp_parser_template_id
        /home/marxin/Programming/gcc/gcc/cp/parser.c:16994
0xa18cfc cp_parser_class_name
        /home/marxin/Programming/gcc/gcc/cp/parser.c:24216
0xa14c45 cp_parser_qualifying_entity
        /home/marxin/Programming/gcc/gcc/cp/parser.c:6864
0xa14c45 cp_parser_nested_name_specifier_opt
        /home/marxin/Programming/gcc/gcc/cp/parser.c:6546
0xa036be cp_parser_constructor_declarator_p
        /home/marxin/Programming/gcc/gcc/cp/parser.c:29163
0xa036be cp_parser_decl_specifier_seq
        /home/marxin/Programming/gcc/gcc/cp/parser.c:14576
0xa2122e cp_parser_parameter_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:23278
0xa222bb cp_parser_template_parameter
        /home/marxin/Programming/gcc/gcc/cp/parser.c:16569
0xa222bb cp_parser_template_parameter_list
        /home/marxin/Programming/gcc/gcc/cp/parser.c:16160
0xa2cda2 cp_parser_explicit_template_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:29828
0x9fff48 cp_parser_member_specification_opt
        /home/marxin/Programming/gcc/gcc/cp/parser.c:25313
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] 9+ messages in thread

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
@ 2020-12-03  9:31 ` marxin at gcc dot gnu.org
  2020-12-03 12:34 ` nathan at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-03  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
  2020-12-03  9:31 ` [Bug c++/98116] " marxin at gcc dot gnu.org
@ 2020-12-03 12:34 ` nathan at gcc dot gnu.org
  2020-12-03 16:43 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-12-03 12:34 UTC (permalink / raw)
  To: gcc-bugs

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

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] 9+ messages in thread

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
  2020-12-03  9:31 ` [Bug c++/98116] " marxin at gcc dot gnu.org
  2020-12-03 12:34 ` nathan at gcc dot gnu.org
@ 2020-12-03 16:43 ` cvs-commit at gcc dot gnu.org
  2020-12-03 16:44 ` nathan at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-03 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:7254a78cf4c419a9b9361289d8c535130cf1dfd0

commit r11-5712-g7254a78cf4c419a9b9361289d8c535130cf1dfd0
Author: Nathan Sidwell <nathan@acm.org>
Date:   Thu Dec 3 08:40:43 2020 -0800

    c++: Testcases [PR 98115]

    These two testcases provide coverage for 98115, which doesn't trigger on
all hosts.

            PR c++/98115
            PR c++/98116
            gcc/testsuite/
            * g++.dg/template/pr98115.C: New.
            * g++.dg/template/pr98116.C: New.

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-03 16:43 ` cvs-commit at gcc dot gnu.org
@ 2020-12-03 16:44 ` nathan at gcc dot gnu.org
  2020-12-04 15:27 ` nathan at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-12-03 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Fixed 7254a78cf4c

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-12-03 16:44 ` nathan at gcc dot gnu.org
@ 2020-12-04 15:27 ` nathan at gcc dot gnu.org
  2020-12-04 16:39 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-12-04 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
I think there's an existing defect that my array changes made more prevalent.

This testcase ICEs with and without my changes, when additional checking is
enabled:

./cc1plus -std=c++20 pr98116.C --param=hash-table-verification-limit=10000000
-fchecking=2

We're getting confused comparing template aliases that map to the same type.

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-12-04 15:27 ` nathan at gcc dot gnu.org
@ 2020-12-04 16:39 ` cvs-commit at gcc dot gnu.org
  2020-12-07 16:49 ` cvs-commit at gcc dot gnu.org
  2020-12-07 16:51 ` nathan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-04 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:5a26d4a204c8a462a7e0a1a86bb2f25ecd470aad

commit r11-5745-g5a26d4a204c8a462a7e0a1a86bb2f25ecd470aad
Author: Nathan Sidwell <nathan@acm.org>
Date:   Fri Dec 4 08:34:41 2020 -0800

    c++: Revert dependent-array changes [PR 98116]

    The changes reverted here are exposing an existing problem with alias
    template comparisons.  The typename_type changes are also incomplete,
    possibly for similar reasons.  It seems safer to revert them, fix the
    underlying issue and then move forwards.

    The testcases is adjusted to more robustly check the specialization
    table, and ICEs with and without the c++ changes.

    Revert:
    62fb1b9e0da c++: Fix array type dependency [PR 98107]
    07589ca2b2c c++: typename_type structural comparison
    29ae1d7751 c++: Extend build_array_type API

            PR c++/98116
            gcc/cp/
            * cp-tree.h (comparing_typenames): Delete.
            (cplus_build_array_type): Remove default parm.
            * pt.c (comparing_typenames): Delete.
            (spec_hasher::equal): Don't increment it.
            * tree.c (set_array_type_canon): Remove dep parm.
            (build_cplus_array_type): Remove dep parm changes.
            (cp_build_qualified_type_real): Remove dependent array type
            changes.
            (strip_typedefs): Likewise.
            * typeck.c (structural_comptypes): Revert comparing_typename
            changes.
            gcc/testsuite/
            * g++.dg/template/pr98116.C: Enable robust checking.

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-12-04 16:39 ` cvs-commit at gcc dot gnu.org
@ 2020-12-07 16:49 ` cvs-commit at gcc dot gnu.org
  2020-12-07 16:51 ` nathan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-07 16:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:9d0eb0ae948f0fbee208cfb9a86133abea650f81

commit r11-5824-g9d0eb0ae948f0fbee208cfb9a86133abea650f81
Author: Nathan Sidwell <nathan@acm.org>
Date:   Mon Dec 7 07:02:58 2020 -0800

    c++: check alias match for specializations [PR98116]

    This fixes the underlying problem my recent (backedout) changes to
    array type creation uncovered.  We had paths through
    structural_comptypes that ignored alias templates, even when
    significant.  This adds the necessary checks.

            PR c++/98116
            gcc/cp/
            * typeck.c (structural_comptypes): Move early outs to comptype.
            Always check template-alias match when comparing_specializations.
            (comptypes): Do early out checking here.
            gcc/testsuite/
            * g++.dg/template/pr98116.C: Remove dg-ice.
            * g++.dg/template/pr98116-2.C: New.

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

* [Bug c++/98116] [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba
  2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-12-07 16:49 ` cvs-commit at gcc dot gnu.org
@ 2020-12-07 16:51 ` nathan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-12-07 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Fixed 9d0eb0ae948

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

end of thread, other threads:[~2020-12-07 16:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  9:31 [Bug c++/98116] New: [11 Regression] ICE in strip_typedefs, at cp/tree.c:1744 since r11-5663-g329ae1d7751346ba marxin at gcc dot gnu.org
2020-12-03  9:31 ` [Bug c++/98116] " marxin at gcc dot gnu.org
2020-12-03 12:34 ` nathan at gcc dot gnu.org
2020-12-03 16:43 ` cvs-commit at gcc dot gnu.org
2020-12-03 16:44 ` nathan at gcc dot gnu.org
2020-12-04 15:27 ` nathan at gcc dot gnu.org
2020-12-04 16:39 ` cvs-commit at gcc dot gnu.org
2020-12-07 16:49 ` cvs-commit at gcc dot gnu.org
2020-12-07 16:51 ` 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).