TEST repository for https://forge.sourceware.org/ experimenting.
- C++ 30.8%
- C 30.2%
- Ada 14.3%
- D 6.1%
- Go 5.6%
- Other 12.5%
IPA-CP contains special logic to create specially marked clones with constants that come from all callees (that are constant in all contexts). In the past that was the only case in which the heuristics tried to assess the effect of multiple constants at once (that is no longer true since GCC 16) and they are also useful when we realize we can refine them still further in the case of recursive calls (such as in testsuite/gcc.dg/ipa/pr93707.c) turn to carry more constants after the initial "all-context" clone is created. Unfortunately, the code creating the clones simply redirects all incoming call graph edges which may include those which were indirect in the phase of the algorithm which gathered IPA-CP lattices and the arguments in these calls might contain different values than all initially known ones, leading to miscompilations like the one in PR125207. Since GCC 16 already feeds the heuristics with all known constants that are passed along with the constant the evaluation was initiated for, the all-context nodes are really only necessary for the recursive refinement cases described above. It seems appropriate to only create them when they are what they are called, when there can be no indirect or unknown calls to them, i.e. when they are local. This has the nice effect of simplifying decide_whether_version_node somewhat. There is some testsuite fallout. First, IPA-CP will now no longer clone a non-static function to only remove a (non-constant) parameter. This likely only makes sense with tiny values of param ipa-cp-eval-threshold or very small functions which are likely going to be inlined anyway. But gcc.dg/vla-1.c expected that to happen so I made the function to be cloned static. The testcase libgomp.c/ipcp-cb-spec1.c stopped working for the same reason (the outlined task body has its address taken) but looking into the dumps the test does not seem to test what it is supposed to, the test function was completely eliminated before IPA. I have therefore changed it to really propagate constants. gcc/ChangeLog: 2026-06-02 Martin Jambor <mjambor@suse.cz> PR ipa/125207 * ipa-cp.cc (decide_about_value): Add detailed dumping about skipping a value when there are no edges for it. Make dumping about skipping because of growth limit violation consistent with other cases. (decide_whether_version_node): Only create all-context nodes for local nodes, remove the logic doing it in other cases, allow cloning for single constant lattices for non-local nodes. Adjust dumping. gcc/testsuite/ChangeLog: 2026-06-02 Martin Jambor <mjambor@suse.cz> PR ipa/125207 * gcc.dg/ipa/pr125207.c: New test. * gcc.dg/vla-1.c (f1): Make function f1 static. libgomp/ChangeLog: 2026-06-03 Martin Jambor <mjambor@suse.cz> PR ipa/125207 * testsuite/libgomp.c/ipcp-cb-spec1.c (test): Rework. |
||
|---|---|---|
| .forgejo | ||
| .github | ||
| c++tools | ||
| config | ||
| contrib | ||
| fixincludes | ||
| gcc | ||
| gnattools | ||
| gotools | ||
| include | ||
| INSTALL | ||
| libada | ||
| libatomic | ||
| libbacktrace | ||
| libcc1 | ||
| libcody | ||
| libcpp | ||
| libdecnumber | ||
| libffi | ||
| libga68 | ||
| libgcc | ||
| libgcobol | ||
| libgfortran | ||
| libgm2 | ||
| libgo | ||
| libgomp | ||
| libgrust | ||
| libiberty | ||
| libitm | ||
| libobjc | ||
| libphobos | ||
| libquadmath | ||
| libsanitizer | ||
| libssp | ||
| libstdc++-v3 | ||
| libvtv | ||
| lto-plugin | ||
| maintainer-scripts | ||
| zlib | ||
| .b4-config | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| ABOUT-NLS | ||
| ar-lib | ||
| ChangeLog | ||
| ChangeLog.jit | ||
| ChangeLog.tree-ssa | ||
| compile | ||
| config-ml.in | ||
| config.guess | ||
| config.rpath | ||
| config.sub | ||
| configure | ||
| configure.ac | ||
| COPYING | ||
| COPYING.LIB | ||
| COPYING.RUNTIME | ||
| COPYING3 | ||
| COPYING3.LIB | ||
| depcomp | ||
| install-sh | ||
| libtool-ldflags | ||
| libtool.m4 | ||
| ltgcc.m4 | ||
| ltmain.sh | ||
| ltoptions.m4 | ||
| ltsugar.m4 | ||
| ltversion.m4 | ||
| lt~obsolete.m4 | ||
| MAINTAINERS | ||
| MAINTAINERS.yml | ||
| Makefile.def | ||
| Makefile.in | ||
| Makefile.tpl | ||
| missing | ||
| mkdep | ||
| mkinstalldirs | ||
| move-if-change | ||
| multilib.am | ||
| README | ||
| SECURITY.txt | ||
| symlink-tree | ||
| test-driver | ||
| ylwrap | ||
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.