public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101239] New: "Internal compiler error: Error reporting routines re-entered." in size_in_bytes_loc
Date: Mon, 28 Jun 2021 10:17:38 +0000	[thread overview]
Message-ID: <bug-101239-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101239
           Summary: "Internal compiler error: Error reporting routines
                    re-entered." in size_in_bytes_loc
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

This valid code produces an ICE:

template<typename T>
struct Blerk
{
  template<typename Ptr>
    static constexpr auto
    type(Ptr p = Ptr(), int n = 0)
    -> decltype(p[n])
    { return false; }

  template<typename Ptr>
    static constexpr int
    type(...)
    { return 1; }

  decltype(type<T*>()) f() const;
};

struct S;
extern Blerk<S[]> p;
auto s = p.f();
struct S { };


ice.C: In substitution of 'template<class Ptr> static constexpr decltype (p[n])
Blerk<S []>::type(Ptr, int) [with Ptr = S (*)[]]':
ice.C:15:20:   required from 'struct Blerk<S []>'
ice.C:20:11:   required from here
ice.C:7:18: error: invalid use of array with unspecified bounds
    7 |     -> decltype(p[n])
      |                 ~^
ice.C: In instantiation of 'struct Blerk<S []>':
ice.C:20:11:   required from here
ice.C:15:20: error: call of overloaded 'type()' is ambiguous
   15 |   decltype(type<T*>()) f() const;
      |            ~~~~~~~~^~
'
Internal compiler error: Error reporting routines re-entered.
0x138c3fd size_in_bytes_loc(unsigned int, tree_node const*)
        /home/jwakely/src/gcc/gcc/gcc/tree.c:3486
0x138c3fd size_in_bytes_loc(unsigned int, tree_node const*)
        /home/jwakely/src/gcc/gcc/gcc/tree.c:3474
0xb5b6ec pointer_int_sum(unsigned int, tree_code, tree_node*, tree_node*, bool)
        /home/jwakely/src/gcc/gcc/gcc/c-family/c-common.c:3301
0xb3b078 cp_build_array_ref(unsigned int, tree_node*, tree_node*, int)
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:3708
0x8f2036 build_new_op_1
        /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6743
0x8f25ad build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6772
0xb295df build_x_array_ref(unsigned int, tree_node*, tree_node*, int)
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:4385
0xaa51b4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:19874
0xac2677 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:16119
0x9b0580 dump_template_bindings
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:482
0x9a9ba7 dump_substitution
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:1638
0x9a9ba7 dump_substitution
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:1630
0x9a9ba7 dump_function_decl
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:1796
0x9b1a18 decl_to_string
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:3216
0x9b1a18 cp_printer
        /home/jwakely/src/gcc/gcc/gcc/cp/error.c:4389
0x1c6ed6c pp_format(pretty_printer*, text_info*)
        /home/jwakely/src/gcc/gcc/gcc/pretty-print.c:1475
0x1c52850 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        /home/jwakely/src/gcc/gcc/gcc/diagnostic.c:1275
0x1c556b7 diagnostic_impl
        /home/jwakely/src/gcc/gcc/gcc/diagnostic.c:1437
0x1c556b7 inform(unsigned int, char const*, ...)
        /home/jwakely/src/gcc/gcc/gcc/diagnostic.c:1516
0x8e1cb6 print_z_candidate
        /home/jwakely/src/gcc/gcc/gcc/cp/call.c:3782
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.

             reply	other threads:[~2021-06-28 10:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 10:17 redi at gcc dot gnu.org [this message]
2021-06-28 10:22 ` [Bug c++/101239] " redi at gcc dot gnu.org
2021-06-28 13:23 ` cvs-commit at gcc dot gnu.org
2021-10-01 10:32 ` pinskia at gcc dot gnu.org
2021-12-13 19:32 ` arthur.j.odwyer at gmail dot com
2021-12-14  0:02 ` pinskia at gcc dot gnu.org
2021-12-27 15:01 ` cvs-commit at gcc dot gnu.org
2021-12-27 15:02 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101239-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).