https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109112
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |danglin at gcc dot gnu.org
--- Comment #14 from John David Anglin <danglin at gcc dot gnu.org> ---
On targets without linker plugin support (such as hppa64-hp-hpux11.11, or when
running with -fno-use-linker-plugin), two of the new LTO tests added in
r17-...-g684c9811dee fail:
FAIL: g++-dg-lto-ipa-cp-assume-01.exe scan-ltrans-tree-dump-not optimized
"__builtin_abort"
FAIL: g++-dg-lto-ipa-sra-assume-1-01.exe scan-wpa-ipa-dump-times sra "Will
split parameter 0" 6
In both tests, the functions under test have external linkage (foo/bar in
ipa-cp-assume and the tested functions in ipa-sra-assume-1_0.C). Without a
linker plugin, LTO does not receive LDPR_PREVAILING_DEF_IRONLY symbol
resolution and must conservatively treat those functions as externally
visible/interposable, preventing cross-TU IPA-CP constant propagation in
ipa-cp-assume and reducing IPA-SRA parameter splitting in ipa-sra-assume-1 from
6 to 3.
Adding /* { dg-require-linker-plugin "" } */ to both tests (or -fwhole-program)
resolves the failures on non-plugin targets.
Untested fix:
--- a/gcc/testsuite/g++.dg/lto/ipa-cp-assume_0.C
+++ b/gcc/testsuite/g++.dg/lto/ipa-cp-assume_0.C
@@ -1,5 +1,6 @@
/* { dg-lto-options {{ -O3 -flto -fdump-tree-optimized }} } */
/* { dg-lto-do link } */
+/* { dg-require-linker-plugin "" } */
/* The point of this test is to propagate the constant into the assume body in
the other file, infer the value range for 'x', evaluate bar to 0, meaning
--- a/gcc/testsuite/g++.dg/lto/ipa-sra-assume-1_0.C
+++ b/gcc/testsuite/g++.dg/lto/ipa-sra-assume-1_0.C
@@ -1,5 +1,6 @@
/* { dg-lto-options {{ -O2 -fno-inline -fipa-sra -fdump-ipa-sra-details
-fdump-tree-optimized -flto }} } */
/* { dg-lto-do link } */
+/* { dg-require-linker-plugin "" } */
struct S
{