Skip to content
Snippets Groups Projects
Commit 4e306222 authored by Aldy Hernandez's avatar Aldy Hernandez
Browse files

[PR tree-optimization/107732] [range-ops] Handle attempt to abs() negatives.

The threader is creating a scenario where we are trying to solve:

	[NEGATIVES] = abs(x)

While solving this we have an intermediate value of UNDEFINED because
we have no positive numbers.  But then we try to union the negative
pair to the final result by querying the bounds.  Since neither
UNDEFINED nor NAN have bounds, they need to be specially handled.

	PR tree-optimization/107732

gcc/ChangeLog:

	* range-op-float.cc (foperator_abs::op1_range): Early exit when
	result is undefined.

gcc/testsuite/ChangeLog:

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