Skip to content
Snippets Groups Projects
Commit 91c963ea authored by Andrew Pinski's avatar Andrew Pinski
Browse files

Fix PR 110874: infinite loop in gimple_bitwise_inverted_equal_p with fre

This changes gimple_bitwise_inverted_equal_p to use a 2 different match patterns
to try to match bit_not wrapped with a possible nop_convert and a comparison
also wrapped with a possible nop_convert. This is to avoid being recursive.

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

gcc/ChangeLog:

	PR tree-optimization/110874
	* gimple-match-head.cc (gimple_bit_not_with_nop): New declaration.
	(gimple_maybe_cmp): Likewise.
	(gimple_bitwise_inverted_equal_p): Rewrite to use gimple_bit_not_with_nop
	and gimple_maybe_cmp instead of being recursive.
	* match.pd (bit_not_with_nop): New match pattern.
	(maybe_cmp): Likewise.

gcc/testsuite/ChangeLog:

	PR tree-optimization/110874
	* gcc.c-torture/compile/pr110874-a.c: New test.
parent 9020da78
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