mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
d3e963d1ccc3500654bec4e2ac94360e864ed343
-(a ptrdiff b) pattern by allowing a nop conversion between the neg and ptrdiff [PR121921]
When I tried to fix this before I didn't realize there was already a pattern for `-(a ptrdiff b) -> (b ptrdiff a)`, I had added a complex pattern to match `ptr0 - (ptr0 - ptr1)`. But with there being a pattern for `-(a ptrdiff b)`, we just need to extend the pattern to support a nop conversion inbetween the negative and the ptrdiff. Also the check for TYPE_OVERFLOW_UNDEFINED was wrong, in the case of `-(a - b) -> (b - a)`, the check is !TYPE_OVERFLOW_SANITIZED so this pattern should use the same check. Bootstrapped and tested on x86_64-linux-gnu. Changes since v1: * v2: Use the old type of the pointer_diff rather than ssizetype. PR tree-optimization/121921 gcc/ChangeLog: * match.pd (`-(a ptrdiff b)`): Extend for a nop_convert between the neg and ptrdiff. gcc/testsuite/ChangeLog: * gcc.dg/pr121921-1.c: New test. Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
…
…
…
…
…
…
…
…
…
…
…
…
…
…
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
Languages
C++
30.7%
C
30.1%
Ada
14.4%
D
6.1%
Go
5.7%
Other
12.5%