https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84047
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> --- I posted a patch for a similar issue reported in bug 83776 (https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02144.html). It handles MEM_REFs and diagnoses the test case in comment #0 (I must have missed that when I opened this bug) but it doesn't handle the test case in comment #2.