Skip to content
Snippets Groups Projects
Commit f2901002 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

re PR tree-optimization/86401 (The "For constants M and N, if M == (1LL <<...

re PR tree-optimization/86401 (The "For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,..." opts are only in fold-const.c and in RTL)

	PR tree-optimization/86401
	* fold-const.c (fold_binary_loc) <case BIT_AND_EXPR>: Move the
	((A & N) + B) & M -> (A + B) & M etc. optimization into ...
	(fold_bit_and_mask): ... here.  New helper function for match.pd.
	* fold-const.h (fold_bit_and_mask): Declare.
	* match.pd (((A & N) + B) & M -> (A + B) & M): New optimization.

	* gcc.dg/tree-ssa/pr86401-1.c: New test.
	* gcc.dg/tree-ssa/pr86401-2.c: New test.
	* c-c++-common/rotate-9.c: New test.

From-SVN: r262485
parent 8de583fc
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