This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/79536] [5/6/7 Regression] ICE in fold_binary_loc, at fold-const.c:9060
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Feb 2017 10:58:29 +0000
- Subject: [Bug middle-end/79536] [5/6/7 Regression] ICE in fold_binary_loc, at fold-const.c:9060
- Auto-submitted: auto-generated
- References: <bug-79536-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #4)
> 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)
Why? negate_expr_p checks
case COMPLEX_EXPR:
return negate_expr_p (TREE_OPERAND (t, 0))
&& negate_expr_p (TREE_OPERAND (t, 1));
so it is negatable.