Skip to content
Snippets Groups Projects
Commit e7d5b9aa authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

tree-optimization/116514 - handle pointer difference in bit-CCP

When evaluating the difference of two aligned pointers in CCP we
fail to handle the EXACT_DIV_EXPR by the element size that occurs.
The testcase then also exercises modulo to test alignment but
modulo by a power-of-two isn't handled either.

	PR tree-optimization/116514
	* tree-ssa-ccp.cc (bit_value_binop): Handle EXACT_DIV_EXPR
	like TRUNC_DIV_EXPR.  Handle exact division of a signed value
	by a power-of-two like a shift.  Handle unsigned division by
	a power-of-two like a shift.
	Handle unsigned TRUNC_MOD_EXPR by power-of-two, handle signed
	TRUNC_MOD_EXPR by power-of-two if the result is zero.

	* gcc.dg/tree-ssa/ssa-ccp-44.c: New testcase.
parent 898e3e95
No related branches found
No related tags found
No related merge requests found
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