Compiler optimization be a harsh mistress.
The larger question of whether optimizations are hardware-dependent is interesting. In some sense, sure. But there are a lot of optimizations in modern compilers that apply equally well to the PDP-11 and to the AMD64; they're just not that different.
My homework assignment for you: write a C function of three or four lines which loops over an array of structs and does some computation for each one, including some conditional and a call to a one-line static function; compile it with -c -O0 -Wa,-adhlns=unoptimized.lst and with -c -O5 -fomit-frame-pointer -Wa,-adhlns=optimized.lst; list the optimizations you notice in the difference between unoptimized.lst, and hazard a guess at which of them are applicable on a PDP-11.