https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113314
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Indeed, if this is a single-threaded program, then this code:
63 void
64 fd_add_to_fd_list(volatile struct fdlist* list, int fd)
65 {
66 int next;
67 int new;
68 int old;
69 int last;
70 redo_next:
71 next = fdtab[fd].update.next;
72 if (next > -2)
73 goto done;
74 if (next == -2)
75 goto redo_next;
does look like an infinite loop when next == 2.
Perhaps the presence of the atomic builtin later in the function should be a
clue to the analyzer that this is multi-threaded, and that
fdtab[fd].update.next can be changed (presuambly by another thread)