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

[PR tree-optimization/107394] Canonicalize global franges as they are read back.

The problem here is that we're inlining a global range with NANs into
a function that has been tagged with __attribute__((optimize
("-ffinite-math-only"))).  As the global range is copied from
SSA_NAME_RANGE_INFO, its NAN bits are copied, which then cause
frange::verify_range() to fail a sanity check making sure no NANs
creep in when !HONOR_NANS.

I think what we should do is nuke the NAN bits as we're restoring the
global range.  For that matter, if we use the frange constructor,
everything except that NAN sign will be done automatically, including
dropping INFs to the min/max representable range when appropriate.

	PR tree-optimization/107394

gcc/ChangeLog:

	* value-range-storage.cc (frange_storage_slot::get_frange): Use
	frange constructor.

gcc/testsuite/ChangeLog:

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