The compiler is smart enough that it doesn’t create an array temporary. See my previous response here: Size of long array - #44 by ivanpribec
Update:
Under -O2
they compile to the same instructions, but under -Og
as used by @Harper the compiler uses extra move instructions to traverse the array. You can inspect the instruction generated in Compiler Explorer: Compiler Explorer