[PATCH] x86: Set optimize to INT_MAX for -Os

Jan Beulich JBeulich@suse.com
Tue Mar 19 08:07:00 GMT 2019


>>> On 19.03.19 at 02:43, <hjl.tools@gmail.com> wrote:
> On Mon, Mar 18, 2019 at 7:35 PM Jan Beulich <JBeulich@suse.com> wrote:
>>
>> >>> On 17.03.19 at 00:50, <hjl.tools@gmail.com> wrote:
>> > Set optimize to INT_MAX, instead of -1, for -Os so that -Os will include
>> > -O2 optimization.
>>
>> I didn't think -Os should be a superset of -O2. Iirc it's not for e.g.
>> gcc. Why would this be a good idea? Judging by the PR it should
>> rather be the doc to get changed imo.
> 
> -Os was designed to include -O2.

Well, taking compilers for comparison, -O<number> typically implies
optimization for performance. This often is requiring different
adjustments to generated code than size optimizations. I understand
(from the doc fragment) that it was meant to be that way; I wonder
though whether this shouldn't be re-considered (and to be honest,
back when you had introduced it, I merely looked at code and hence
didn't realize that code - matching my expectations - wasn't in line
with the doc).

Jan




More information about the Binutils mailing list