https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58101
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Further reduced: int a [1]; void foo (int n) { if (n <= 1) return; int i = 1; a [i] = a [i - 1]; } This is one of these false positives warning where we should maybe not warn but instead just change the code to be a trap. Note in the original testcase, GCC is able to remove the loop and just change it to one statement. That is part of the reason for the warning even. clang does not warn about the above because they only warn for the literal a[1] case.