https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77425
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 39534 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39534&action=edit gcc7-pr77425.patch Untested fix. I believe if we are going to return false, then nothing is/should be looking at the iterator object anymore, at least all other uses of linkp field dereference it anyway and for NULL list &list->first gives an UB NULL pointer.