This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Change default optimization level to -Og
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Fri, 27 Oct 2017 09:00:59 -0600
- Subject: Re: [PATCH] Change default optimization level to -Og
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DA3F2E14A3
- References: <DB6PR0801MB2053E6F13ED5CA0FA6D0D9F483450@DB6PR0801MB2053.eurprd08.prod.outlook.com> <20171026195026.GW14653@tucnak>
On 10/26/2017 01:50 PM, Jakub Jelinek wrote:
> On Thu, Oct 26, 2017 at 05:12:40PM +0000, Wilco Dijkstra wrote:
>> GCC's default optimization level is -O0. Unfortunately unlike other compilers,
>> GCC generates extremely inefficient code with -O0. It is almost unusable for
>> low-level debugging or manual inspection of generated code. So a -O option is
>> always required for compilation. -Og not only allows for fast compilation, but
>> also produces code that is efficient, readable as well as debuggable.
>> Therefore -Og makes for a much better default setting.
>>
>> Any comments?
>>
>> 2017-10-26 Wilco Dijkstra <wdijkstr@arm.com>
>>
>> * opts.c (default_options_optimization): Set default to -Og.
>>
>> doc/
>> * invoke.texi (-O0) Remove default mention.
>> (-Og): Add mention of default setting.
>
> This would only severely confuse users. -Og has lots of unresolved issues
> for debugging experience, and changing the default this way is IMHO
> extremely undesirable.
And changing a default that has been in place for 30 years just seems
unwise at this point.
jeff