Skip to content
Snippets Groups Projects
Commit 239a625e authored by Roger Sayle's avatar Roger Sayle Committed by Roger Sayle
Browse files

fold-const.c (negate_expr_p): We can optimize -((int)X>>C) where C is an...

fold-const.c (negate_expr_p): We can optimize -((int)X>>C) where C is an integer constant one bit less than...


	* fold-const.c (negate_expr_p) <RSHIFT_EXPR>: We can optimize
	-((int)X>>C) where C is an integer constant one bit less than the
	size of X into (unsigned)X>>C.  Similarly for unsigned->signed.
	(negate_expr) <RSHIFT_EXPR>: Implement the above transformations.

	* simplify-rtx.c (simplify_unary_operation): Also implement the
	above transformations at the RTL level.

	* gcc.c-torture/execute/20040311-1.c: New test case.

From-SVN: r79334
parent 4b0b51c9
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment