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

[range-op-float] Set NAN possibility for INF + (-INF) and vice versa.

Some combinations of operations can yield a NAN even if no operands
have the possiblity of a NAN.  For example, [-INF] + [+INF] = NAN and
vice versa.

For [-INF,+INF] + [-INF,+INF], frange_arithmetic will not return a
NAN, and since the operands have no possibility of a NAN, we will
mistakenly assume the result cannot have a NAN.  This fixes the
oversight.

gcc/ChangeLog:

	* range-op-float.cc (foperator_plus::fold_range): Set NAN for
	addition of different signed infinities.
	(range_op_float_tests): New test.
parent b305793b
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