[flang] Minor fix in folding of reshape intrinsic (flang-compiler/f18#842)
authorkiranchandramohan <kiranchandramohan@gmail.com>
Tue, 26 Nov 2019 21:34:03 +0000 (21:34 +0000)
committerSteve Scalpone <sscalpone@nvidia.com>
Tue, 26 Nov 2019 21:34:03 +0000 (15:34 -0600)
commit201119217fd8d3eac9e19d79cddc5e00d4c72500
treeb08e010097fe831e812729eebb731a5ae3d6d732
parent477bd3c67e343cc2b8715841e0cb1189a15d5dc5
[flang] Minor fix in folding of reshape intrinsic (flang-compiler/f18#842)

The standard permits source to have more elements than the
result (as specified by the SHAPE arg). While copying, ensure
that we do not copy more than the number of elements of the
result.

Original-commit: flang-compiler/f18@6b8284f4f2cff32fcf5483ea93d1d239ecdacd33
Reviewed-on: https://github.com/flang-compiler/f18/pull/842
flang/lib/evaluate/fold.cc
flang/test/evaluate/folding06.f90