https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57997
--- Comment #9 from Marc Glisse <glisse at gcc dot gnu.org> --- I'd rather work on improving the warnings so we can tell the user how bad his code is, but in case, we had a similar request in GMP, a code that was inspired by libstdc++ valarray: https://gmplib.org/list-archives/gmp-bugs/2014-January/003315.html and the discussion may contain hints relevant to the valarray case.