public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/107835] New: [13 Regression] ICE in build2, at tree.cc:5020 since r13-254-gdd3c7873a61019e9
Date: Wed, 23 Nov 2022 13:54:45 +0000	[thread overview]
Message-ID: <bug-107835-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107835
           Summary: [13 Regression] ICE in build2, at tree.cc:5020 since
                    r13-254-gdd3c7873a61019e9
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: sayle at gcc dot gnu.org
  Target Milestone: ---

The following crashes:

$ cat test-loop2.ii
template <typename> struct __new_allocator;
template <typename> struct allocator_traits;
template <typename _Tp> struct allocator_traits<__new_allocator<_Tp>> {
  using pointer = _Tp *;
};
struct __alloc_traits : allocator_traits<__new_allocator<int>> {};
template <typename _ForwardIterator, typename _Size, typename _Tp>
_ForwardIterator __uninitialized_default_n_a(_ForwardIterator __first, _Size,
                                             _Tp) {
  unsigned __n;
  for (; __n; --__n, ++__first)
    ;
  return __first;
}
struct _Vector_impl_data {
  __alloc_traits::pointer _M_finish;
  _Vector_impl_data() : _M_finish() {}
};
struct _Vector_base {
  ~_Vector_base();
  _Vector_impl_data _M_impl;
} resize___new_size;
struct Trans_NS_std_vector : _Vector_base {
  void resize() {
    _M_impl._M_finish =
        __uninitialized_default_n_a(_M_impl._M_finish, resize___new_size, 0);
  }
};
template <class> using vector = Trans_NS_std_vector;
struct Platform {
  static void get(vector<Platform> *platforms) { platforms->resize(); }
};
main() {
  vector<Platform> platformList;
  Platform::get(&platformList);
}

$ g++ test-loop2.ii -O2 -fwhole-program -c -w
during GIMPLE pass: sccp
test-loop2.ii: In function ‘int main()’:
test-loop2.ii:33:1: internal compiler error: in build2, at tree.cc:5008
   33 | main() {
      | ^~~~
0x86bfa2 build2(tree_code, tree_node*, tree_node*, tree_node*)
        /home/marxin/Programming/gcc/gcc/tree.cc:5008
0xe0528f build2_loc
        /home/marxin/Programming/gcc/gcc/tree.h:4606
0xe0528f fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /home/marxin/Programming/gcc/gcc/fold-const.cc:13820
0xe0526a fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /home/marxin/Programming/gcc/gcc/fold-const.cc:13818
0x1fe6a65 chrec_apply(unsigned int, tree_node*, tree_node*)
        /home/marxin/Programming/gcc/gcc/tree-chrec.cc:632
0x1252b8b compute_overall_effect_of_inner_loop(loop*, tree_node*)
        /home/marxin/Programming/gcc/gcc/tree-scalar-evolution.cc:471
0x1256635 final_value_replacement_loop(loop*)
        /home/marxin/Programming/gcc/gcc/tree-scalar-evolution.cc:3759
0x1305915 execute
        /home/marxin/Programming/gcc/gcc/tree-ssa-loop.cc:411
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

             reply	other threads:[~2022-11-23 13:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 13:54 marxin at gcc dot gnu.org [this message]
2022-11-23 13:54 ` [Bug tree-optimization/107835] " marxin at gcc dot gnu.org
2022-11-23 20:57 ` rguenth at gcc dot gnu.org
2022-11-29 14:26 ` jakub at gcc dot gnu.org
2022-11-29 14:37 ` jakub at gcc dot gnu.org
2022-11-30 10:46 ` cvs-commit at gcc dot gnu.org
2022-11-30 10:46 ` 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-107835-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).