On 11/17/18 3:45 PM, Martin Sebor wrote: > -Wsizeof-pointer-memaccess fails with an ICE when one of > the arguments is ill-formed (error_mark_node). To avoid > the error the attached patch has the function bail in this > case. > > Martin > > gcc-88065.diff > > PR c/88065 - ICE in -Wsizeof-pointer-memaccess on an invalid strncpy > > gcc/c-family/ChangeLog: > > PR c/88065 > * c-warn.c (sizeof_pointer_memaccess_warning): Bail if source > or destination is an error. > > gcc/testsuite/ChangeLog: > > PR c/88065 > * gcc.dg/Wsizeof-pointer-memaccess2.c: New test. This is probably OK. But before final ACK, is there a point earlier where we could/should have bailed out?
ie, when does the ERROR_MARK get created and if you were to look at the flow from that point to the offending call to sizeof_pointer_memaccess_warning is there a better place to bail? jeff