The code in the question — both variants — exhibits 'undefined behaviour' and consequently "anything is possible". That includes "the program crashes", and "the program behaves as if the overflow is legitimate" and "the program does its utmost to wipe the machine clean of all data". Fortunately, the last option is seldom exercised by compiler writers. (See also 'Nasal Demons' in the Wikipedia article.)
The code in the question — both variants — is broken. Until the for
loop is changed to the idiomatic:
for (i = 0; i < 10; i++)
the programs are simply broken, invoking undefined behaviour, and anything can happen when they're run.
If you wish, you can analyze the assembly generated for the two faulty programs if you wish (but it is better not to). My best guess as to difference in behaviour would be that the version with the constant-length array (CLA) lays out the array and index variables differently from the version with the variable-length array (VLA), so overflowing the array in the VLA version overwrites different data from overflowing the array in the CLA version.
But there's little point in investigating what happens in detail. The behaviour is undefined, and knowing what happens with one source file and one version of one compiler with one set of compilation flags on one platform won't make the code correct or reliable or portable or anything else useful. Adding a second array can alter things; changing the compiler version, using a different compiler, moving to a new platform, or changing the optimization level of the compilation — any of these can change what happens, and you have nobody to blame but yourself because the code is broken. The problem is in the code, not in what the compiler does with it.