Jakub Jelinek fd1b0aefda tree-ssa-dom: can_infer_simple_equiv fixes [PR108068]
As reported in the PR, tree-ssa-dom.cc uses real_zerop call to find
if a floating point constant is zero and it shouldn't try to infer
equivalences from comparison against it if signed zeros are honored.
This doesn't work at all for decimal types, because real_zerop always
returns false for them (one can have different representations of decimal
zero beyond -0/+0), and it doesn't work for vector compares either,
as real_zerop checks if all elements are zero, while we need to avoid
infering equivalences from comparison against vector constants which have
at least one zero element in it (if signed zeros are honored).
Furthermore, as mentioned by Joseph, for decimal types many other values
aren't singleton.

So, this patch stops infering anything if element mode is decimal, and
otherwise uses instead of real_zerop a new function, real_maybe_zerop,
which will work even for decimal types and for complex or vector will
return true if any element is or might be zero (so it returns true
for anything but constants for now).

2022-12-23  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/108068
	* tree.h (real_maybe_zerop): Declare.
	* tree.cc (real_maybe_zerop): Define.
	* tree-ssa-dom.cc (record_edge_info): Use it instead of
	real_zerop or TREE_CODE (op1) == SSA_NAME || real_zerop.  Always set
	can_infer_simple_equiv to false for decimal floating point types.

	* gcc.dg/dfp/pr108068.c: New test.
2022-12-23 16:12:21 +01:00
2022-12-22 19:44:07 -05:00
2022-12-22 00:17:29 +00:00
2022-12-18 00:16:57 +00:00
2022-12-22 00:17:29 +00:00
2022-12-17 00:17:56 +00:00
2022-12-16 00:17:46 +00:00
2022-12-22 00:17:29 +00:00
2022-12-20 00:17:00 +00:00
2022-12-22 00:17:29 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%