https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> --- So perhaps this: --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -581,8 +581,8 @@ fold_negate_expr (location_t loc, tree t) case COMPLEX_EXPR: if (negate_expr_p (t)) return fold_build2_loc (loc, COMPLEX_EXPR, type, - fold_negate_expr (loc, TREE_OPERAND (t, 0)), - fold_negate_expr (loc, TREE_OPERAND (t, 1))); + negate_expr (TREE_OPERAND (t, 0)), + negate_expr (TREE_OPERAND (t, 1))); break; case CONJ_EXPR: (and I guess handle CONJ_EXPR the same)