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: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Fri, 27 Oct 2017 13:04:01 +0000
- Subject: Re: [PATCH] Change default optimization level to -Og
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- References: <DB6PR0801MB2053E6F13ED5CA0FA6D0D9F483450@DB6PR0801MB2053.eurprd08.prod.outlook.com>,<CA+=Sn1nCP1Dwco3PRocG+iLStSw-HBefPgeJj07Lyf-OtAwyeQ@mail.gmail.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Andrew Pinski wrote:
> I think this goes against what most folks are used to. I know you are
> saying most folks are used to a compiler defaulting to optimizations
> on but I don't think that is true. In fact GCC has been this way
> since day one.
Well it may depend which part of the industry you're coming from. GCC
certainly has a long history doing it one way, however other compilers took
a different approach and have supported optimized debugging for decades.
So I don't understand the use of having a "turn every optimization off" option,
let alone for it to be the default today...
> Plus you also missed changing the following part of the documentation:
> If you are not using some other optimization option, consider using
> -Og (see Optimize Options) with -g. With no -O option at all, some
> compiler passes that collect information useful for debugging do not
> run at all, so that -Og may result in a better debugging experience.
Sure, the doc part of the patch will need further revision if we agree to
change the default.
Wilco