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

ROHIT KUMAR via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 7 01:19:03 PDT 2017


This is weird, I ran the build again and this time it showed error at a
different location.

[image: Inline image 1]

On Fri, Jul 7, 2017 at 1:35 PM, Craig Topper <craig.topper at gmail.com> wrote:

> That's not supposed to happen. What was the failure?
>
> On Fri, Jul 7, 2017 at 1:01 AM ROHIT KUMAR <rohitpoddar92 at gmail.com>
> wrote:
>
>> Yes. With this flag, I got compilation failure.
>>
>> On Jul 7, 2017 1:28 PM, "Craig Topper" <craig.topper at gmail.com> wrote:
>>
>>> 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
>>>
>> --
> ~Craig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170707/4786db37/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-07-07 at 1.43.15 PM.png
Type: image/png
Size: 112007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170707/4786db37/attachment.png>


More information about the cfe-dev mailing list