[flang] Don't fold operation when shapes differ
When folding a binary operation between two array constructors, it
is necessary to check if each value contained in the left operand
has the same rank and shape as the one on the right.
Otherwise, lowering would end up with an operation between values
of different ranks/shapes, which could result in a crash.
For instance, the following code was crashing the compiler:
integer :: x(4), y(2, 2), z(4)
z = (/x/) + (/y/)
Fixes #60229
Reviewed By: klausler, jeanPerier
Differential Revision: https://reviews.llvm.org/D147181