Merge pull request #4928 from kumpera/ptr_to_struct_intrinsic