This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Move NEG NOT optimization from fold_unary to negate_expr


In progress to fix PR middle-end/23666, the transformation for turning - (~a)
into a+1 has to be moved to negate_expr from the orginal spot in fold_unary so
that it can be used without manually adding a seperate code for doing it, we can
just use negate_expr_p and negate_expr.

The next part to fix PR middle-end/23666 depends on fixing PR middle-end/25125.

OK? Bootstrapped and tested on x86_64-pc-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
	* fold-const.c (negate_expr_p): Return true for BIT_NOT_EXPR.
	(fold_unary) <case NEGATE_EXPR>: Move -(~a) transformation to ...
	(negate_expr): Here.

Attachment: moveNEGNOT.diff.txt
Description: ASCII C program text


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]