-f and -O options interact in non-obvious, order dependent ways
-f* flags are both implemented by manipulating a set of flags in
DynFlags. These manipulations occur in the order that the flags occur in the command line. This leads to some rather surprising behavior.
For instance, if the user wants to compile with optimization but specifically wants to disable specialisation, they might enter
-fno-specialise -O1. This, however, would not do what the user expects as
-fspecialise, overriding the first flag.
This is surprising and poorly documented behavior at best. See the later comments of #10491 (closed) which lead to this ticket.