public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/108503] New: [13 Regression] ICE in get_array_or_vector_nelts, at cp/constexpr.cc:4119
Date: Mon, 23 Jan 2023 17:49:22 +0000	[thread overview]
Message-ID: <bug-108503-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 108503
           Summary: [13 Regression] ICE in get_array_or_vector_nelts, at
                    cp/constexpr.cc:4119
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started between 20221127 and 20221204 :


$ cat z1.cc
namespace std {
  template<typename T> struct tuple_size;
  template<int, typename> struct tuple_element;
}
struct A {
  template <int I> int& get() { return 1; }
};
template<> struct std::tuple_size<A> { static const int value = 3; };
template<int I> struct std::tuple_element<I,A> { using type = int; };
struct B {
  A *begin();
  A *end();
};
void f (B a)
{
  #pragma omp for collapse(2)
  for (auto [i, j, k] : a)
    for (int l = i; l < j; l += k)
      ;
}


$ g++-13-20230122 -c z1.cc -fopenmp -Wall
z1.cc: In member function 'int& A::get()':
z1.cc:6:40: error: cannot bind non-const lvalue reference of type 'int&' to an
rvalue of type 'int'
    6 |   template <int I> int& get() { return 1; }
      |                                        ^
z1.cc: In function 'void f(B)':
z1.cc:18:25: internal compiler error: in get_array_or_vector_nelts, at
cp/constexpr.cc:4119
   18 |     for (int l = i; l < j; l += k)
      |                         ^
0x88770e get_array_or_vector_nelts
        ../../gcc/cp/constexpr.cc:4119
0x887804 eval_and_check_array_index
        ../../gcc/cp/constexpr.cc:4171
0x88b5e9 cxx_eval_array_reference
        ../../gcc/cp/constexpr.cc:4208
0x8826ed cxx_eval_constant_expression
        ../../gcc/cp/constexpr.cc:7516
0x880e9a cxx_eval_constant_expression
        ../../gcc/cp/constexpr.cc:7042
0x8837ac cxx_eval_indirect_ref
        ../../gcc/cp/constexpr.cc:5642
0x8837ac cxx_eval_constant_expression
        ../../gcc/cp/constexpr.cc:7358
0x88d3ba cxx_eval_outermost_constant_expr
        ../../gcc/cp/constexpr.cc:8252
0x892882 maybe_constant_value(tree_node*, tree_node*, bool)
        ../../gcc/cp/constexpr.cc:8527
0x956053 fold_for_warn(tree_node*)
        ../../gcc/cp/expr.cc:421
0xc1d801 warn_tautological_cmp(op_location_t const&, tree_code, tree_node*,
tree_node*)
        ../../gcc/c-family/c-warn.cc:485
0x84369b build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
        ../../gcc/cp/call.cc:7354
0xb485cd build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
        ../../gcc/cp/typeck.cc:4722
0xa1c40f cp_parser_omp_for_cond
        ../../gcc/cp/parser.cc:42701
0xa1c40f cp_parser_omp_for_loop
        ../../gcc/cp/parser.cc:43652
0xa410f6 cp_parser_omp_for
        ../../gcc/cp/parser.cc:44005
0xa56f14 cp_parser_omp_construct
        ../../gcc/cp/parser.cc:48527
0xa20a7f cp_parser_pragma
        ../../gcc/cp/parser.cc:49207
0xa2740c cp_parser_statement
        ../../gcc/cp/parser.cc:12434
0xa28884 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12909

             reply	other threads:[~2023-01-23 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 17:49 gscfq@t-online.de [this message]
2023-01-24  0:48 ` [Bug c++/108503] " pinskia at gcc dot gnu.org
2023-01-24  9:08 ` rguenth at gcc dot gnu.org
2023-01-24 16:24 ` jason at gcc dot gnu.org
2023-01-24 16:30 ` jakub at gcc dot gnu.org
2023-01-25 13:45 ` jakub at gcc dot gnu.org
2023-01-26  9:48 ` cvs-commit at gcc dot gnu.org
2023-01-26 10:25 ` jakub 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-108503-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).