https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70444
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> --- This code is likely broken, it looks like the last example in https://gmplib.org/manual/C_002b_002b-Interface-Limitations.html The temporary expression for v1+v2 dies before the next line, and you have a dangling reference in the dead+v3 expression.