1. 13
  1. 10

    Starting with GCC 12 vectorization is enabled at the -O2 optimization level

    Given how prevalent -O2 is, this might actually be a hidden performance boost that will apply broadly to most of the Linux ecosystem.

    1. 3

      Heads-up if you are compiling C++ code with -Wall: you will see a bogus warning it you assign/append a 1-char string literal to std::string. For example:

      void f (std::string& s)
      {
        s = "a";
        s += "b";
      }
      

      The bug report with the details is here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329

      I suggested that the GCC developers delay the release until this is fixed but looks like they went ahead without a fix. Hopefully in 12.2.

      You can usually work around the warning by changing to a char literal (which will also be more efficient).

      1. 3

        You won’t find it yet in the release notes, but GCC 12.1 is finally able to compile recent D code, thanks to a big bump of the version of the D frontend integrated in GCC.

        The maintainer, Iain Buclaw, said that it will be documented more officially later.

        1. 1

          Oh, thank you for pointing this out. This is a huge accomplishment for D !

        2. 2

          Just noticed support for m68k on OpenBSD is gone in gcc 12.