From: Florian Weimer on
gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1144#note_5989...
Current GCC compiles this code to use the `msrkc` instruction:
```c
#include <stdlib.h>
int
f (int a, int b)
{
int result;
if (__builtin_mul_overflow (a, b, &result))
abort ();
return result;
}
int
main (int argc, char **argv)
{
return f (atoi (argv[1]), atoi (argv[2]));
}
```
Maybe not exactly common, but also not super-obscure. I think the kernel uses
`__builtin_mul_overflow` in some places. `s390.md` in GCC has patterns for
the other instructions, too, search for `TARGET_Z14`.
The sort-of working aspect was the reason why I added the run-time check to
glibc. I was worried that without it, some z14 binaries will appear to work,
but crash in obscure ways for some operations because GCC happened to emit one
of the new instructions.