I know why GCC doesn\'t re-order members of a structure by default, but I seldom write code that relies on the order of the structure, so is there some way I can flag my str
There is no such option in GCC. And, I sure, it can not be introduced in any sensible fashion. About padding optimizations please look at this discussion.
The only exception I know is hot/cold structure fields splitting, that can be done in some cases (still I am not sure, that GCC can do it even in profile-guided mode, I know ICC can). This feature is not under user control and is performed on call-graphs where conservativeness of such transformation over data-flow is provable.