[cfe-dev] Clangs equivalent to GCCs -Og flag?

David Blaikie dblaikie at gmail.com
Fri Jul 31 07:37:00 PDT 2015


On Jul 31, 2015 7:27 AM, "Robinson, Paul" <
Paul_Robinson at playstation.sony.com> wrote:
>
> People ask about this from time to time, but we've never done anything
about it.
>
> One thing I noticed about GCC –Og is that it's 99% identical to their
–O1.  I'd be curious about people's experience using Clang –O1 –g and
whether that experience is somewhere close to reasonable.

It's still likely to be not great for debugging - mostly because it still
runs SROA which promotes allocas into registers and out variable
liveness/tracking falls down quickly there.

Chandlers repeatedly suggested that we fix debug info to the point that -O1
is highly debuggable (might involve changing -O1 too, if there are
fundamentally destructive things in there that hurt debugging) and then
make that the default (because its often as fast or faster than compiling
at -O1 anyway, which is what people usually care about - compile time and
simplicity/understandability)

>
> --paulr
>
>
>
> From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On
Behalf Of David Blaikie
> Sent: Wednesday, July 29, 2015 10:13 AM
> To: Dan Walmsley; cfe-dev Developers
>
> Subject: Re: [cfe-dev] Clangs equivalent to GCCs -Og flag?
>
>
>
>
>
>
>
> On Wed, Jul 29, 2015 at 8:42 AM, Dan Walmsley <dan at walms.co.uk> wrote:
>
> Thanks,
>
>
>
>     Perhaps there might be some documentation somewhere that would give
me an idea of which optimizations to enable individually?
>
>
> Not really - optimized debug info is still pretty lacking in Clang. Even
the most common/basic optimizations (SROA, for example) are going to pretty
heavily impact debuggability today.
>
> - Dave
>
>>
>>
>>
>> Dan
>>
>> ________________________________
>>
>> Date: Wed, 29 Jul 2015 06:40:06 -0700
>> Subject: Re: [cfe-dev] Clangs equivalent to GCCs -Og flag?
>> From: dblaikie at gmail.com
>> To: dan at walms.co.uk
>> CC: cfe-dev at cs.uiuc.edu
>>
>>
>>
>>
>> On Jul 29, 2015 3:23 AM, "Dan Walmsley" <dan at walms.co.uk> wrote:
>> >
>> > GCC has a debug level flag of -Og which enables all optimizers that
won't degrade the debugging experience greatly.
>> >
>> > Does clang have an equivalent?
>>
>> No, clang had no equivalent at this time.
>>
>> >
>> > Thanks in advance.
>> >
>> > Dan
>> >
>> > _______________________________________________
>> > cfe-dev mailing list
>> > cfe-dev at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150731/419c74b1/attachment.html>


More information about the cfe-dev mailing list