Martin Jambor f0f372fab3 ipa: Avoid another ICE when dealing with type-incompatibilities (PR 108959)
PR 108959 shows one more example where undefined code with type
incompatible accesses to stuff passed in parameters can cause an ICE
because we try to create a VIEW_CONVERT_EXPR of mismatching sizes:

1. IPA-CP tries to push one type from above,

2. IPA-SRA (correctly) decides the parameter is useless because it is
   only used to construct an argument to another function which does not
   use it and so the formal parameter should be removed,

3. but the code reconciling IPA-CP and IPA-SRA transformations still
   wants to perform the IPA-CP and overrides the built-in DCE of
   useless statements and tries to stuff constants into them
   instead, constants of a type with mismatching type and size.

This patch avoids the situation in IPA-SRA by purging the IPA-CP
results from any "aggregate" constants that are passed in parameters
which are detected to be useless.  It also removes IPA value range and
bits information associated with removed parameters stored in the same
structure so that the useless information is not streamed later on.

gcc/ChangeLog:

2023-03-22  Martin Jambor  <mjambor@suse.cz>

	PR ipa/108959
	* ipa-sra.cc (zap_useless_ipcp_results): New function.
	(process_isra_node_results): Call it.

gcc/testsuite/ChangeLog:

2023-03-17  Martin Jambor  <mjambor@suse.cz>

	PR ipa/108959
	* gcc.dg/ipa/pr108959.c: New test.
2023-04-05 16:37:26 +02:00
2023-04-01 00:17:38 +00:00
2022-11-15 08:32:29 +00:00
2023-03-17 00:17:03 +00:00
2023-03-29 00:17:01 +00:00
2022-09-01 00:17:39 +00:00
2022-08-31 00:16:45 +00:00
2023-02-28 00:18:40 +00:00
2022-11-24 00:17:47 +00:00
2023-01-16 11:52:17 +01:00
2023-03-25 00:16:51 +00:00
2023-03-29 00:17:01 +00:00
2023-01-16 11:52:17 +01:00
2023-03-26 00:16:45 +00:00
2023-01-16 11:52:17 +01:00
2023-01-23 00:16:34 +00:00
2023-03-20 00:17:08 +00:00
2023-03-01 00:18:20 +00:00
2023-03-23 00:17:30 +00:00
2023-03-29 00:17:01 +00:00
2023-04-03 00:16:43 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-18 00:16:40 +00:00
2023-03-03 00:16:38 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-03-22 00:17:03 +00:00
2022-11-24 00:17:47 +00:00
2022-07-19 17:07:04 +03:00
2023-03-23 00:17:30 +00:00
2021-12-21 09:10:57 +01: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.
S
Description
Yggdrasil port of the GNU Compiler Collection
Readme 978 MiB
Languages
C++ 33%
C 27.4%
Ada 13%
Go 7.1%
D 7%
Other 12.1%