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

            Bug ID: 102200
           Summary: ice in put_ref, at pointer-query.cc:1351
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C source code:

long try_extension_len;
void try_extension_str() {
  char *curr = try_extension_str;
  char end = sizeof try_extension_str;
  while (try_extension_len) {
    if (curr < end)
      *curr = ';';
    if (curr > &end)
      curr = &end;
  }
}

compiled with recent gcc trunk and compiler flag -O2, does this:

during GIMPLE pass: strlen
bug754.c: In function ‘try_extension_str’:
bug754.c:2:6: internal compiler error: in put_ref, at pointer-query.cc:1351
    2 | void try_extension_str() {
      |      ^~~~~~~~~~~~~~~~~
0xc7696c pointer_query::put_ref(tree_node*, access_ref const&, int)
        ../../trunk.git/gcc/pointer-query.cc:1351

The bug first seems to occur sometime between git hash 7a6f40d0452ec76e
and 9695e1c23be5b5c5. Only 21 commits.

Reply via email to