aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/Serialization
diff options
context:
space:
mode:
authorPeter Klausler <pklausler@nvidia.com>2022-07-08 16:16:42 -0700
committerPeter Klausler <pklausler@nvidia.com>2022-07-13 16:50:57 -0700
commitbe68a6adfba29b275272cb36e606bc0cb08518b3 (patch)
tree46007e6a700c11fd1e7b2e2731e84d46c6841a69 /clang/lib/ExtractAPI/Serialization
parente3923d000a6a0393bf6bd535b65433ed0de1ec28 (diff)
downloadllvm-be68a6adfba29b275272cb36e606bc0cb08518b3.zip
llvm-be68a6adfba29b275272cb36e606bc0cb08518b3.tar.gz
llvm-be68a6adfba29b275272cb36e606bc0cb08518b3.tar.bz2
[flang] Error detection/avoidance for TRANSFER with empty MOLD= type
When MOLD= is an array and there is no SIZE= in a call to TRANSFER(), the size of an element of the MOLD= is used as the denominator in a division to establish the extent of the vector result. When the total storage size of the SOURCE= is known to be zero, the result is empty and no division is needed. To avoid a division by zero at runtime, we need to check for a zero-sized MOLD= element type when the storage size of SOURCE= is nonzero and there is no SIZE=. Further, in the compilation-time rewriting of calls to SHAPE(TRANSFER(...)) and SIZE(TRANSFER(...)) for constant folding and simplification purposes, we can't replace the call with an arithmetic element count expression when the storage size of SOURCE= is not known to be zero and the element size of MOLD= is not known to be nonzero at compilation time. These changes mostly affect tests using a MOLD= argument that is an assumed-length character. Differential Revision: https://reviews.llvm.org/D129680
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization')
0 files changed, 0 insertions, 0 deletions