https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #8 from Marek Polacek ---
Author: mpolacek
Date: Fri Feb 17 09:51:38 2017
New Revision: 245526
URL: https://gcc.gnu.org/viewcvs?rev=245526=gcc=rev
Log:
PR middle-end/79536
* fold-const.c (fold_negate_expr_1): Renamed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #7 from rguenther at suse dot de ---
On Thu, 16 Feb 2017, mpolacek at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
>
> --- Comment #6 from Marek Polacek ---
> Yes, but see my Comment 3 regarding
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #6 from Marek Polacek ---
Yes, but see my Comment 3 regarding STRIP_SIGN_NOPS.
Also the typedef is necessary, otherwise there are no NOP_EXPRs (huh).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
Richard Biener changed:
What|Removed |Added
Priority|P3 |P2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #5 from Richard Biener ---
(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:
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #4 from Marek Polacek ---
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
--- Comment #3 from Marek Polacek ---
The problem here is that we have a NOP_EXPR: (int) -x. negate_expr_p returns
true for that, which means that fold_negate_expr cannot return NULL_TREE. But
that's what happens, and that leads to a crash in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
Marek Polacek changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79536
Marek Polacek changed:
What|Removed |Added
Keywords||ice-on-valid-code
Component|c