public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/110882] New: ICE with -fanalyzer on zero-sized array
@ 2023-08-02 22:23 dmalcolm at gcc dot gnu.org
  2023-08-02 22:23 ` [Bug analyzer/110882] " dmalcolm at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2023-08-02 22:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110882
           Summary: ICE with -fanalyzer on zero-sized array
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

ICE seen with -fanalyzer on this code:

-----------------------------------------------------------------

struct csv_row {
  char *columns[0];
};

void
parse_csv_line(int n_columns,
               const char *columns[])
{
  for (int n = 0; n < n_columns; n++) {
      columns[n] = ((void *)0);
  }
}

void parse_csv_data(int n_columns,
                    struct csv_row *entry)
{
  parse_csv_line(n_columns, (const char **)entry->columns);
}

-----------------------------------------------------------------

ICE happens on gcc 13 onwards; specifically, affects:
- trunk: https://godbolt.org/z/To7c1r8ME
- gcc 13.2: https://godbolt.org/z/a5zr5Ga4b

gcc 12.3 is not affected

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-05-09 17:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02 22:23 [Bug analyzer/110882] New: ICE with -fanalyzer on zero-sized array dmalcolm at gcc dot gnu.org
2023-08-02 22:23 ` [Bug analyzer/110882] " dmalcolm at gcc dot gnu.org
2023-08-02 22:24 ` dmalcolm at gcc dot gnu.org
2023-08-03 13:48 ` [Bug analyzer/110882] [13/14 Regression] " cvs-commit at gcc dot gnu.org
2023-08-03 13:54 ` [Bug analyzer/110882] [13 " dmalcolm at gcc dot gnu.org
2023-08-03 14:47 ` cvs-commit at gcc dot gnu.org
2023-08-03 14:53 ` dmalcolm at gcc dot gnu.org
2023-10-17 10:28 ` rguenth at gcc dot gnu.org
2024-05-09 17:11 ` cvs-commit at gcc dot gnu.org
2024-05-09 17:11 ` cvs-commit at gcc dot gnu.org
2024-05-09 17:52 ` [Bug analyzer/110882] " dmalcolm at gcc dot gnu.org

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).