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

tree-optimization/89317 - another pattern for &p->x != p + 4

As seen in the original testcase for PR89317 we are missing
comparison simplification patterns for &p->x != p + 4.  Fixed
by making an existing one apply.  To make the pattern apply
during CCP we need to simplify ccp_fold to not use GENERIC
folding of conditions but also use GIMPLE folding.

	PR tree-optimization/89317
	* tree-ssa-ccp.cc (ccp_fold): Handle GIMPLE_COND via
	gimple_fold_stmt_to_constant_1.
	* match.pd (&a != &a + c): Apply to pointer_plus with non-ADDR_EXPR
	base as well.

	* gcc.dg/tree-ssa/pr89317.c: Amend.
parent 324e9953
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