[Bug middle-end/103143] New: [12 Regression] ICE due to infinite recursion in pointer-query.cc

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 9 00:05:35 GMT 2021


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

            Bug ID: 103143
           Summary: [12 Regression] ICE due to infinite recursion in
                    pointer-query.cc
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

As mentioned in bug 101397 comment #7, the following test cases causes infinite
recursion (and ultimately an ICE) in pointer-query.cc:

$ cat a.c && gcc -O2 -S -Wall a.c
xgcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.


typedef __SIZE_TYPE__ size_t;

void
__attribute__ ((noinline))
foo (size_t x)
{
  struct T { char buf[64]; char buf2[64]; } t;
  char *p = &t.buf[8];
  char *r = t.buf2;
  size_t i;

  for (i = 0; i < x; i++)
    {
      r = __builtin_mempcpy (r, p, i);
      p = r + 1;
    }
}


More information about the Gcc-bugs mailing list