Merge upstream to 12921 and fix warnings introduced.
Fix aliasing warnings