Could anyone please help me understand
why Clang reallocates the same memory address for different variables
while their lifetime intersect?
I am using a sample program (below) to show the problem.
I compile the program with clang -O0, variable j in function ok has the
same memory address as variable solutions in function nqueens. Function ok is called inside function nqueens, which means that the life time of the variables intersect.
Compiling the program with gcc or clang -O1, however, they are assigned different memory addresses.