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

Craig Topper via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 6 23:25:24 PDT 2017


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170706/930f9c9d/attachment.html>


More information about the cfe-dev mailing list