Fixing MinSize attribute handling was discussed in D11363. This is a prerequisite patch to doing that.
The handling of OptSize when lowering mem* functions was broken on Darwin because it wants to ignore -Os for these cases, but the existing logic also made it ignore -Oz (MinSize).
The Linux change demonstrates a widespread problem. The backend doesn't recognize the MinSize attribute by itself; it assumes that MinSize implies OptSize. Fixing this more generally will be a follow-on patch or two.