Jakub Jelinek 49ec63666e widening_mul: Fix a > ~b to .ADD_OVERFLOW optimization [PR98256]
Unfortunately, my latest tree-ssa-math-opts.c patch broke the following
testcase.  The problem is that the code is adding .ADD_OVERFLOW or
.SUB_OVERFLOW before or after the stmt on which the function has been
called, which is normally a addition or subtraction that has all the
operands.
But in the a > ~b optimization that stmt is the ~b stmt and the other
comparison operand might be defined only after that ~b stmt, so we can't
insert the .ADD_OVERFLOW next to ~b that we want to delete, but need to
insert it before the a > temp comparison that uses it; and in that case
when removing the BIT_NOT_EXPR stmt we need to ensure the caller doesn't do
gsi_next because gsi_remove already points the iterator to the next stmt.

2020-12-13  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/98256
	* tree-ssa-math-opts.c (match_uaddsub_overflow): For BIT_NOT_EXPR,
	only handle a single use, and insert .ADD_OVERFLOW before the
	comparison rather than after the BIT_NOT_EXPR.  Return true iff
	it is BIT_NOT_EXPR and it has been removed.
	(math_opts_dom_walker::after_dom_children) <case BIT_NOT_EXPR>:
	If match_uaddsub_overflow returned true, continue instead of break.

	* gcc.c-torture/compile/pr98256.c: New test.
2020-12-13 19:28:07 +01:00
2020-11-26 00:16:41 +00:00
2020-12-09 00:16:50 +00:00
2020-11-19 00:16:30 +00:00
2020-10-30 00:16:29 +00:00
2020-12-10 00:16:47 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-12-11 18:22:52 +00:00
2020-07-31 00:16:26 +00:00
2020-12-06 00:16:44 +00:00
2020-12-09 00:16:50 +00:00
2020-12-06 00:16:44 +00:00
2020-12-08 14:01:04 -08:00
2020-12-10 00:16:47 +00:00
2020-12-06 00:16:44 +00:00
2020-11-26 00:16:41 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-11-30 00:16:27 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-12-06 00:16:44 +00:00
2020-12-13 00:16:19 +00:00
2020-12-06 00:16:44 +00:00
2020-11-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-12-06 00:16:44 +00:00
2020-12-02 11:04:01 -07:00
2020-12-06 00:16:44 +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%