Skip to content

-O0 is not a recommended option for clang #902

Closed

Description

@jirislaby

According to https://bugs.llvm.org/show_bug.cgi?id=35950#c10, we should not be using -O0 on its own. So what do you suggest?

Stay with -O0 and extend it to -O0 -Xclang -disable-O0-optnone?

Or upgrade to -O1 and use -O1 -Xclang -disable-llvm-passes?

The latter currently causes test failures, as it seems. The former is being built right now at https://travis-ci.org/klee/klee/builds/383711164?utm_source=github_status&utm_medium=notification

Activity

  1. changed the title [-]-O0 is not a recommended option[/-] [+]-O0 is not a recommended option for clang[/+] on May 25, 2018
  2. humeafo commented on May 26, 2018

    @humeafo

    Or is it possible to add an additional pass to remove the optnone attr on klee-side?

  3. jirislaby commented on Jun 15, 2018

    @jirislaby
    ContributorAuthor

    I wouldn't remove optnone unconditionally, it might cause problems for locations where added intentionally.

    But it turned out that -O0 -Xclang -disable-O0-optnone works quite well.

  4. humeafo commented on Jun 20, 2018

    @humeafo

    It's a better option except some more work on tests, perhaps this should be mentioned in docs for beginners when 6.0 port is merged to trunk.

  5. kren1 commented on Jul 2, 2018

    @kren1
    Contributor

    Just a note that these options don't work for LLVM 3.4

  6. jirislaby commented on Jul 2, 2018

    @jirislaby
    ContributorAuthor
  7. ccadar commented on Jul 2, 2018

    @ccadar
    Contributor

    BTW, I think we should change add instructions on the web for LLVM 3.6, and slowly "migrate" to it. Any volunteers for the instructions? ;)

  8. MartinNowack commented on Jul 18, 2018

    @MartinNowack
    Contributor

    Looking at #937 and #920, I think we should make this the default option for the runtime library. Using -O0 and -g and as suggested by @jirislaby -Xclang -disable-O0-optnone for newer clang versions.

    KLEE can be still invoked with the -optimize flag.

  9. kren1 commented on Mar 5, 2019

    @kren1
    Contributor

    As a note this is a fun comparision between the options on our get_sign.c: https://godbolt.org/z/tdtmDy example. It seems the -O0 -Xclang -disable-O0-optnone, -O1 -Xclang -disable-llvm-passesare very similar except that the -O1 option has some lifetime information.

  10. ccadar commented on May 30, 2019

    @ccadar
    Contributor

    I think we can close this one, as we update the tests and the documentation to use/recommend these options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions