On Sun, Mar 14, 2021 at 11:07 PM Kaz Kylheku (Coreutils)
<[email protected]> wrote:
>
> On 2021-03-14 12:55, Jeffrey Walton wrote:
> > The underlying problem is GCC, Clang and friends conflate the user's
> > ISA with ISA the compiler uses. They are not the same - they are
> > distinct. Unfortunately, GCC and Clang never addressed the underlying
> > problem.
>
> Sorry, what does that mean?

It means GCC and Clang will generate for the ISA the developer is
using without guarding it.

A developer may do something like:

  if (cpu_has_avx())
  {
    do_crc32_avx();
  }
  else
  {
    do_crc32();
  }

While Clang and GCC will not guard the code. GCC and Clang will hijack
the developer's ISA and generate code that SIGILL's.

Using Clang I had it happen to me on x86. Clang generated AVX code to
zero a structure because I was using AVX (properly guarded).

Using GCC I had it happen to me on POWER7. GCC used POWER8 in some
prologue because I had some POWER8 code paths (properly guarded).

Jeff

  • Re: [PATCH] cksu... Pádraig Brady
    • Re: [PATCH]... Kristoffer Brånemyr via GNU coreutils General Discussion
      • Re: [PA... Kaz Kylheku (Coreutils)
      • Re: [PA... Pádraig Brady
        • Re:... Pádraig Brady
          • ... Jim Meyering
            • ... Pádraig Brady
        • Re:... Kristoffer Brånemyr via GNU coreutils General Discussion
          • ... Jeffrey Walton
            • ... Kaz Kylheku (Coreutils)
              • ... Jeffrey Walton
          • ... Pádraig Brady
            • ... Pádraig Brady
              • ... Kristoffer Brånemyr via GNU coreutils General Discussion

Reply via email to