[Bug testsuite/104687] New: gcc.dg/lto/20090717_[01].c is an invalid execution test

acoplan at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 25 13:54:47 GMT 2022


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

            Bug ID: 104687
           Summary: gcc.dg/lto/20090717_[01].c is an invalid execution
                    test
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

20090717_0.c has:

struct variable {
        const char *string;
};
struct variable table[] = { };

and 20090717_1.c has:

struct variable {
    const char *string;
};
extern struct variable table[];
int main(int argc, char *argv[])
{
  struct variable *p;
  for(p = table; p->string; p++)
    ;
  return 0;
}

but the access of p->string dereferences a pointer to an empty array, so it
accesses out of bounds, and is therefore invalid. Therefore the test should not
be an execution test in the testsuite. Or am I missing something?


More information about the Gcc-bugs mailing list