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

ROHIT KUMAR via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 6 23:18:36 PDT 2017


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


More information about the cfe-dev mailing list