[cfe-dev] Fwd: Optimization flags causing segfault on clang

Craig Topper via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 7 00:58:44 PDT 2017


You got a compilation failure not a runtime failure?

On Fri, Jul 7, 2017 at 12:19 AM ROHIT KUMAR <rohitpoddar92 at gmail.com> wrote:

> Thanks, Craig.
>
> So with this argument, the build failed on compilation with the last log as
>
> *"BISECT: NOT running pass (60626) optimize barriers pass on function
> ... "*
>
> It points to a function in a class where we also had a high suspicion for.
> So it makes sense.
>
> So it is very likely that the way our code is written is not meeting the
> standards used by clang and one or other optimization is breaking it.
>
> Do you have any idea which flag is doing this "optimize barriers pass on
> function" which we can ignore?
>
>
> On Fri, Jul 7, 2017 at 11:55 AM, Craig Topper <craig.topper at gmail.com>
> wrote:
>
>> You can use -mllvm -opt-bisect-limit=<limit> to bisect where the error
>> occurs. More documentation here http://llvm.org/docs/OptBisect.html
>>
>> ~Craig
>>
>> On Thu, Jul 6, 2017 at 11:18 PM, ROHIT KUMAR via cfe-dev <
>> cfe-dev at lists.llvm.org> wrote:
>>
>>> Hey,
>>>
>>> Context: Android native code built with clang using Android Studio.
>>>
>>> We have been using GCC(Eclipse) for quite a while, now we are trying to
>>> move our huge code base to clang (to AndroidStudio).
>>>
>>> With GCC we were using -O3 optimization and everything was working fine,
>>> but with clang, even -O1 is causing Android apps to crash on runtime with
>>> the seg fault.
>>>
>>> Since apps are working fine when compiled with -O0, so my guess is some
>>> kind of optimization is not supported for our code base which is/are
>>> introduced by O1/2/3 flags.
>>>
>>> Is there a way I can disable the flags introduced by -O1 one-by-one to
>>> figure out the culprit flag(s)?
>>>
>>> Can anyone suggest me such flags to disable optimizations one-by-one? I
>>> tried googling but could not find much help.
>>>
>>> I am stuck on this issue for quite a while now. I would really
>>> appreciate the help. I am looking for a more general advice on flags to
>>> disable optimizations one-by-one with -O1, because making changes in the
>>> code base would not be possible.
>>>
>>> Thanks.
>>> Rohit Kumar
>>>
>>>
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>
>>>
>>
> --
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170707/ab5224cb/attachment.html>


More information about the cfe-dev mailing list