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

match.pd: Optimize X / bool_range_Y to X [PR96094]

When the divisor is bool or has [0, 1] range, as division by
0 is UB, the only remaining option in valid programs is division by 1,
so we can optimize X / bool_range_Y into X.

2020-12-15  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/96094
	* match.pd (X / bool_range_Y -> X): New simplification.

	* gcc.dg/tree-ssa/pr96094.c: New test.
parent 36c9a3fe
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