PR tree-optimization/63302
	* tree-ssa-reassoc.c (optimize_range_tests_xor,
	optimize_range_tests_diff): Use !integer_pow2p () instead of
	tree_log2 () < 0.

	* gcc.c-torture/execute/pr63302.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216391 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/63464
	* gimple.h (gimple_seq_discard): New prototype.
	* gimple.c: Include stringpool.h and tree-ssanames.h.
	(gimple_seq_discard): New function.
	* optabs.h (lshift_cheap_p): New prototype.
	* optabs.c (lshift_cheap_p): New function, moved from...
	* tree-switch-conversion.c (lshift_cheap_p): ... here.
	* tree-ssa-reassoc.c: Include gimplify.h and optabs.h.
	(reassoc_branch_fixups): New variable.
	(update_range_test): Add otherrangep and seq arguments.
	Unshare exp.  If otherrange is NULL, use for other ranges
	array of pointers pointed by otherrangep instead.
	Emit seq before gimplified statements for tem.
	(optimize_range_tests_diff): Adjust update_range_test
	caller.
	(optimize_range_tests_xor): Likewise.  Fix up comment.
	(extract_bit_test_mask, optimize_range_tests_to_bit_test): New
	functions.
	(optimize_range_tests): Adjust update_range_test caller.
	Call optimize_range_tests_to_bit_test.
	(branch_fixup): New function.
	(execute_reassoc): Call branch_fixup.

	* gcc.dg/torture/pr63464.c: New test.
	* gcc.dg/tree-ssa/reassoc-37.c: New test.
	* gcc.dg/tree-ssa/reassoc-38.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216393 138bc75d-0d04-0410-961f-82ee72b054a4
2014-10-17  Richard Biener  <rguenther@suse.de>

	* fold-const.c (fold_comparison): Remove redundant constant
	folding and operand swapping.
	(fold_binary_loc): Do comparison operand swapping here.
	(fold_ternary_loc): Canonicalize operand order for
	commutative ternary operations.
	* tree.c (commutative_ternary_tree_code): Add DOT_PROD_EXPR
	and FMA_EXPR.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216394 138bc75d-0d04-0410-961f-82ee72b054a4