Skip to content
Snippets Groups Projects
Commit d0d8b5d8 authored by Andrew MacLeod's avatar Andrew MacLeod
Browse files

Process only valid shift ranges.

When shifting outside the valid range of [0, precision-1], we can
choose to process just the valid ones since the rest is undefined.
this allows us to produce results for x << [0,2][+INF, +INF] by discarding
the invalid ranges and processing just [0,2].

	gcc/
	PR tree-optimization/93781
	* range-op.cc (get_shift_range): Rename from
	undefined_shift_range_check and now return valid shift ranges.
	(operator_lshift::fold_range): Use result from get_shift_range.
	(operator_rshift::fold_range): Ditto.
	gcc/testsuite/
	* gcc.dg/tree-ssa/pr93781-1.c: New.
	* gcc.dg/tree-ssa/pr93781-2.c: New.
	* gcc.dg/tree-ssa/pr93781-3.c: New.
parent 5bba2215
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