Fix for #8042: Instead of loading value and casting, cast pointer and load.
Merge pull request #8046 from ArchRobison/adr/swapcast

Instead of loading value and casting, cast pointer and load