https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110442

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
We should disable all instrumentation, at least if it needs a runtime.

With -fsanitize=undefined:
```
void *
resolve (void)
{
  int a = 1 << 32;
  __builtin_cpu_init ();
  if (__builtin_cpu_supports ("f16c"))
    return f1;
  else
    return f2;
}
```

```
$ ./a
a.c:18:13: runtime error: shift exponent 32 is too large for 32-bit type 'int'
Segmentation fault         (core dumped) ./a
```

It is OK with -fsanitize=undefined -fsanitize-trap=undefined as no runtime is
needed.

Reply via email to