Okay, so it does it somehow by magic. By your words the automatic decision made by GCC has to be a compile-time one. For runtime, all code generated by GCC will be 64-bit safe; in other words, doing a malloc() say always returns a 64-bit value and there is no way this will be optimized at runtime?
With no option to tune it. Why would you even use the slower one when you can avoid it? It's not going to change anything... unless there is a bug in the CPU that causes the short opcode to go haywire.
Yes, malloc always returns a 64-bit quantity, and it does so in a register, which makes accesses cheap with small values: int *x = malloc(sizeof(int)); *x = 5; equates to mov dword ptr [rax], 5 which is the c7 00 code with a 32-bit operand for the "5".