Andrew Pinski cc2003cd87 Fix PR 93044: extra cast is not removed
In this case we are not removing convert to a bigger size
back to the same size (or smaller) if signedness does not
match.
For an example:
```
  signed char _1;
...
  _1 = *a_4(D);
  b_5 = (short unsigned int) _1;
  _2 = (unsigned char) b_5;
```
The inner cast is not needed and can be removed but was not.
The match pattern for removing the extra cast is overly
complex so decided to add a new case for rather than trying
to modify the current if statement here.

Committed as approved. Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

	PR tree-optimization/93044
	* match.pd (nested int casts): A truncation (to the same size or smaller)
	can always remove the inner cast.

gcc/testsuite/ChangeLog:

	PR tree-optimization/93044
	* gcc.dg/tree-ssa/cast-1.c: New test.
	* gcc.dg/tree-ssa/cast-2.c: New test.
2023-08-01 00:06:14 +00:00
2023-07-22 00:17:44 +00:00
2023-07-14 00:16:43 +00:00
2023-07-30 00:17:03 +00:00
2023-07-20 00:17:53 +00:00
2023-07-24 00:16:51 +00:00
2023-07-22 00:17:44 +00:00
2023-07-30 00:17:03 +00:00
2023-07-31 00:16:58 +00:00
2023-07-26 00:17:44 +00:00
2023-07-31 11:37:47 +02:00
2023-07-31 11:37:47 +02:00
2023-07-31 11:37:47 +02: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 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%