There are lots of reasons a program might fail to do what's desired when
optimized - dead code is only one of them, any reason to believe that's the
issue at hand? But no, LLVM doesn't really have any support for that.

You might try running your program using the various sanitizersn (address,
memory, undefined behavior sanitizer) to help identify if there are bugs
that could be fixed.

On Thu, Dec 19, 2019 at 12:19 AM Guofeng Zhang via cfe-users <
cfe-users@lists.llvm.org> wrote:

> Hi,
>
> We use clang 8+. Does clang have options (not -O0) that do not remove dead
> code when clang optimize the code?
>
> We have a old project, now migrating to Clang. It works well with -O0, but
> failed when use -O1 to -O3.
>
> Thanks,
>
> Guofeng
>
> _______________________________________________
> cfe-users mailing list
> cfe-users@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to