Congratulations, this is a compiler error. The compiler optimizes your code by evaluating one of the cbrtcalls ahead of time, unfortunately, the version of the compiler cbrtis different from your version in libm. You will also notice that the transfer -O2results in the result v2being “wrong” (although this is mathematically correct).
,
cc (Debian 6.3.0-5) 6.3.0 20170124
(https://gcc.gnu.org/bugs/), .