Update MSVC optimization flags to match GCC/Clang

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: infrastructure

      make/autoconf/flags-cflags.m4

      https://learn.microsoft.com/en-us/cpp/build/reference/o-options-optimize-code

      -O1 is a combination of flags that optimizes for size.
      -O2 is a combination of flags that optimizes for speed.

      C_O_FLAG_NORM is set to -O1.
      C_O_FLAG_HIGH is set to -O1.
      C_O_FLAG_SIZE is set to -Os which only hints to the compiler to prefer optimizing for size, but does not include all the optimizations of -O1.

      C_O_FLAG_NORM should probably be set to either -O2 or -O1 with -Oi. -O1 will not prefer intrinsics without -Oi, so calls such as memcpy(foo, bar, <constant>) will still be function calls in some scenarios.
      C_O_FLAG_HIGH should probably be set to -O2.
      C_O_FLAG_SIZE should probably be set to -O1.

      We could also probably disable exceptions and RTTI, similar to clang/GCC for the JVM, though I think the JVM make use SEH for something so we would have to be careful there.

            Assignee:
            Unassigned
            Reporter:
            Justin King
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: