My English is not perfect.
Visual C++ 2019 16.9.2.
I announced an error a long time ago, I do not find this. MS wrote will be fixed in a later version. But remained:
#include <iostream>
using namespace std;
int x = 1, y = 2;
int * __ptr32 (a[2]) = {&x, &y};
void f(int const &z) { wcout << &z << endl; }
int wmain() {
f(*(a[0]));
int &z = *(a[0]);
int *p = a[0];
wcout << &z << endl << p << endl << &y << endl;
return 0;
}
In a 64 bit program, when a 32 bit pointer is passed to a function, as the address of a reference parameter, reads 64 bit from memory. So, the address will be bad. The program crashes if there is z instead of &z in wcout in the function f. This program requires disabled LARGE_ADDRESS_AWARE among linker's settings. This causes the program can use only 2 GB address space: 0 to 2^31-1 addresses. Debug and Release mode are concerned so. AMD64 is concerned, I have no information about ARM64.
32 bit pointers in 64 bit program useful if the program uses a lot of pointers: lists, trees, etc. This can halve memory need. 64 bit mode required to processor test/benchmark program, what must use 64 bit dlls. In 64 bit mode, there are 16 registers instead of 8, so faster. Memory comb, fill, copy, exchange, compare, arithmetic operations on big numbers has double speed than 32 bit mode.