<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/86415>86415</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            PowerPC Clang 16.0.6 emits fsqrt on unsupported CPUs
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          retroman
      </td>
    </tr>
</table>

<pre>
    machine: powerpc-unknown-freebsd14.0 -- Power Mac G4 MDD, which has a single PowerPC 7455

The test program below crashes with SIGILL due to encountering an fsqrt instruction when built with the command line:
cc -ffast-math -mcpu=603 -lm fsqrt.c
and executes normally when built with:
cc -ffast-math -mcpu=602 -lm fsqrt.c
It also executes normally when built with:
 cc -ffast-math -fno-finite-math-only -mcpu=603 -lm fsqrt.c

These mcpu types also generate the fsqrt with the test program: 603e, 603ev, 604, 604e,  620, 750, g3, 7400, g4, 7450, g4+.
The test program executes normally without -ffast-math with all cpu types above.

This problem is unimportant, and it seems that FreeBSD 14 will be the final release with 32-bit PowerPC support, so this issue may only be useful for documentation.

test program fsqrt.c:
```
#include <stdio.h>
#include <math.h>

int main(void)
{
        double a = 2.;
        double b;

        b = sqrt(a);

 printf("a=%.1f b=%.1f\n", a, b);

        return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVN1u5DYPfRrNDWFDluz5ufDFZuabRYBdIMB-fQBZpsdqZWkqUZnm7QvZTjaTpi1qBKJpUofk4cmoGM3FIbaseWDNaaMSjT60ASn4SblN5_uXdlJ6NA6Z_AJXf8Nw1UVyvzl_c8UQELvYV3XJoSjgKYfhu9LwtYbvpxMTR7iNRo8wqggKonEXi0va0xF2ddMwfmL8y3L-f0QgjATX4C9BTdCh9TfQQcURI9wMjfDj8evjt2_QJwTygE775AiDcRdQDob4eyAwLlJImox3cBvRQZeMpeU-jQjaT5N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