Bug 86004 - [9 regression] Several lto test cases begin failing with r260963
Summary: [9 regression] Several lto test cases begin failing with r260963
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Jakub Jelinek
URL:
Keywords: link-failure
: 86496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-05-30 21:01 UTC by seurer
Modified: 2018-12-11 13:41 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-06-04 00:00:00


Attachments
gcc9-pr86004.patch (1.58 KB, patch)
2018-12-10 15:44 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2018-05-30 21:01:40 UTC
This started with r260963 but that specific revision won't build properly because of an error in a previous revision.  I am not sure if the test cases just need updating (an option was changed on at least some of them).

I saw this on powerpc64 but it also fails on a check of one of them on x86.


> FAIL: g++.dg/lto/20091002-1 cp_lto_20091002-1_0.o-cp_lto_20091002-1_0.o link, -fPIC -flto -Wno-return-type
> FAIL: g++.dg/lto/pr64043 cp_lto_pr64043_0.o-cp_lto_pr64043_0.o link,  -flto -std=c++11 
> FAIL: g++.dg/lto/pr65193 cp_lto_pr65193_0.o-cp_lto_pr65193_0.o link, -fPIC -r -nostdlib -flto -O2 -g -Wno-return-type
> FAIL: g++.dg/lto/pr65302 cp_lto_pr65302_0.o-cp_lto_pr65302_1.o link,  -flto -O2 -Wno-return-type 
> FAIL: g++.dg/lto/pr65316 cp_lto_pr65316_0.o-cp_lto_pr65316_1.o link,  -flto -std=c++11 -g2 -fno-lto-odr-type-merging -O2 -Wno-return-type 
> FAIL: g++.dg/lto/pr65549 cp_lto_pr65549_0.o-cp_lto_pr65549_0.o link,  -std=gnu++14 -flto -g -O2 -fno-inline -flto-partition=max -Wno-return-type 
> FAIL: g++.dg/lto/pr65549 cp_lto_pr65549_0.o-cp_lto_pr65549_0.o link,  -std=gnu++14 -flto -g -Wno-return-type 
> FAIL: g++.dg/lto/pr66180 cp_lto_pr66180_0.o-cp_lto_pr66180_1.o link,  -flto -std=c++14 -r -nostdlib 
> FAIL: g++.dg/lto/pr66705 cp_lto_pr66705_0.o-cp_lto_pr66705_0.o link,  -O2 -flto -flto-partition=max -fipa-pta 
> FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O0 -flto -flto-partition=none -fuse-linker-plugin
> FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O0 -flto -fuse-linker-plugin -fno-fat-lto-objects 
> FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects 
> FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O2 -flto -fuse-linker-plugin
> FAIL: g++.dg/lto/pr69077 cp_lto_pr69077_0.o-cp_lto_pr69077_1.o link,  -O3 -g -flto 
> FAIL: g++.dg/lto/pr69133 cp_lto_pr69133_0.o-cp_lto_pr69133_1.o link,  -flto -O2 
> FAIL: g++.dg/lto/pr69137 cp_lto_pr69137_0.o-cp_lto_pr69137_0.o link,  -std=c++11 -g -flto 
> FAIL: g++.dg/lto/pr79000 cp_lto_pr79000_0.o-cp_lto_pr79000_1.o link, -flto -g
> FAIL: g++.dg/lto/pr81940 cp_lto_pr81940_0.o-cp_lto_pr81940_0.o link,  -O -flto 
> FAIL: g++.dg/lto/pr85176 cp_lto_pr85176_0.o-cp_lto_pr85176_0.o link,  -flto -g1 
> FAIL: gfortran.dg/lto/pr79108 f_lto_pr79108_0.o-f_lto_pr79108_0.o link,  -Ofast -flto --param ggc-min-expand=0 --param ggc-min-heapsize=0
Comment 1 Jan Hubicka 2018-05-30 22:45:57 UTC
Can you please check in g++.log what kind of error you get?
Incremental linking now produce LTO objects while previously it did produce final binary. I went through testcases where this makes difference and added -flinker-output=nolto-rel for them to force original behavior.

Adding -flinker-output=nolto-rel to extra-ld-options will likely make the errors go away, but I would like to know what errors you get because I don't get them on x86-64.

Honza
Comment 2 seurer 2018-05-31 14:17:07 UTC
Sorry about that.  The actual complaints are about a missing plugin from the loader.  I've never seen anything like that before.

gcc/testsuite/gfortran/gfortran.log:/usr/bin/ld: /tmp/ccxyE8Zx.lto.o: plugin needed to handle lto object

seurer@genoa:~/gcc/build/gcc-trunk$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.26.1

I don't see this problem on a newer system that has binutils version 2.30 on it so this is probably a problem with binutils.
Comment 3 seurer 2018-05-31 14:51:42 UTC
I tried a couple of different versions of binutils on one system where this was occurring and it happens with binutils 2.26 but doesn't with 2.27 (and later).
Comment 4 Richard Biener 2018-06-01 07:51:58 UTC
Do we somehow rely on plugin auto-loading now?
Comment 5 Thomas Schwinge 2018-06-04 07:24:17 UTC
For the record, I'm also seeing that ("[...]/ld: /tmp/cc[...].lto.o: plugin needed to handle lto object") on x86_64-pc-linux-gnu, with binutils/ld version 2.25.51.
Comment 6 Jan Hubicka 2018-06-19 10:44:28 UTC
If I recall correctly, old binutils issue warning when plugin produce IL file which is done for incremental linking. I do not think there is a way to prevent this message from gcc side other than requiring binutils 2.27+

One way to silence the warning would be simply to add -flinker-output=nolto-rel to all the testcases (so we do not do incremental IL linking) but it will make it still harder to add testcases for incremental link IL linking if we want to support them on older binutils somehow (i.e. by disabling the tests or tolerating false warning)
Comment 7 Martin Sebor 2018-07-04 17:56:44 UTC
I also see these failures in my builds on x86_64-linux running Fedora 25 with stock Binutils (GNU ld version 2.26.1-1.fc25
).  The ld warning is the same:

  /usr/bin/ld: /tmp/ccIHhHfL.lto.o: plugin needed to handle lto object

From comment #6 it sounds like there are at least two options for how to deal with these failures.  Is there consensus on how to proceed?  (I build on a shared machine where I'm not sure I will be able to upgrade Binutils so I would prefer some other alternative).

$ grep ^FAIL gcc/testsuite/g++/g++.log | grep lto
FAIL: g++.dg/lto/20091002-1 cp_lto_20091002-1_0.o-cp_lto_20091002-1_0.o link, -fPIC -flto -Wno-return-type
FAIL: g++.dg/lto/pr64043 cp_lto_pr64043_0.o-cp_lto_pr64043_0.o link,  -flto -std=c++11 
FAIL: g++.dg/lto/pr65193 cp_lto_pr65193_0.o-cp_lto_pr65193_0.o link, -fPIC -r -nostdlib -flto -O2 -g -Wno-return-type
FAIL: g++.dg/lto/pr65302 cp_lto_pr65302_0.o-cp_lto_pr65302_1.o link,  -flto -O2 -Wno-return-type 
FAIL: g++.dg/lto/pr65316 cp_lto_pr65316_0.o-cp_lto_pr65316_1.o link,  -flto -std=c++11 -g2 -fno-lto-odr-type-merging -O2 -Wno-return-type 
FAIL: g++.dg/lto/pr65549 cp_lto_pr65549_0.o-cp_lto_pr65549_0.o link,  -std=gnu++14 -flto -g -Wno-return-type 
FAIL: g++.dg/lto/pr65549 cp_lto_pr65549_0.o-cp_lto_pr65549_0.o link,  -std=gnu++14 -flto -g -O2 -fno-inline -flto-partition=max -Wno-return-type 
FAIL: g++.dg/lto/pr66180 cp_lto_pr66180_0.o-cp_lto_pr66180_1.o link,  -flto -std=c++14 -r -nostdlib 
FAIL: g++.dg/lto/pr66705 cp_lto_pr66705_0.o-cp_lto_pr66705_0.o link,  -O2 -flto -flto-partition=max -fipa-pta 
FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O0 -flto -flto-partition=none -fuse-linker-plugin
FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects 
FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O0 -flto -fuse-linker-plugin -fno-fat-lto-objects 
FAIL: g++.dg/lto/pr68057 cp_lto_pr68057_0.o-cp_lto_pr68057_1.o link, -O2 -flto -fuse-linker-plugin
FAIL: g++.dg/lto/pr69077 cp_lto_pr69077_0.o-cp_lto_pr69077_1.o link,  -O3 -g -flto 
FAIL: g++.dg/lto/pr69133 cp_lto_pr69133_0.o-cp_lto_pr69133_1.o link,  -flto -O2 
FAIL: g++.dg/lto/pr69137 cp_lto_pr69137_0.o-cp_lto_pr69137_0.o link,  -std=c++11 -g -flto 
FAIL: g++.dg/lto/pr79000 cp_lto_pr79000_0.o-cp_lto_pr79000_1.o link, -flto -g
FAIL: g++.dg/lto/pr81940 cp_lto_pr81940_0.o-cp_lto_pr81940_0.o link,  -O -flto 
FAIL: g++.dg/lto/pr85176 cp_lto_pr85176_0.o-cp_lto_pr85176_0.o link,  -flto -g1
Comment 8 seurer 2018-07-12 14:21:56 UTC
*** Bug 86496 has been marked as a duplicate of this bug. ***
Comment 9 Jan Hubicka 2018-11-12 16:08:10 UTC
I wonder if we can close this based on fact that it only reproduces on sufficiently old binutils and we simply can't support incremental linking on these?
Comment 10 Martin Sebor 2018-11-12 18:08:14 UTC
Both of our (Red Hat internal) build servers have been upgraded to Fedora 29 so we don't see the failures anymore but they will still com up on systems with older Binutils.   Is it possible to add some sort of a dg-require-xxx to prevent the tests from failing when the installed version of Binutils isn't up to par?
Comment 11 Jakub Jelinek 2018-12-10 15:44:33 UTC
Created attachment 45201 [details]
gcc9-pr86004.patch

Untested testsuite fix, tested both on a system with binutils 2.25 (where those tests previously failed, now UNSUPPORTED) and recent ones (where it still PASSes).
Comment 12 Jan Hubicka 2018-12-10 17:08:15 UTC
Thanks a lot for looking into this.  Indeed disabling the tests is
probably good idea, so the patch looks good to me. Somewhere we should
document minimal binutils release supporting incremental link...

Honza
Comment 13 Jakub Jelinek 2018-12-11 10:29:11 UTC
Author: jakub
Date: Tue Dec 11 10:28:39 2018
New Revision: 266974

URL: https://gcc.gnu.org/viewcvs?rev=266974&root=gcc&view=rev
Log:
	PR lto/86004
	* doc/sourcebuild.texi (lto_incremental): Document new effective
	target.

	* lib/target-supports.exp (check_effective_target_lto_incremental):
	New.
	* g++.dg/lto/pr69137_0.C: Require lto_incremental effective target.
	* g++.dg/lto/pr65316_0.C: Likewise.
	* g++.dg/lto/pr85176_0.C: Likewise.
	* g++.dg/lto/pr79000_0.C: Likewise.
	* g++.dg/lto/pr66180_0.C: Likewise.
	* g++.dg/lto/pr65193_0.C: Likewise.
	* g++.dg/lto/pr69077_0.C: Likewise.
	* g++.dg/lto/pr68057_0.C: Likewise.
	* g++.dg/lto/pr66705_0.C: Likewise.
	* g++.dg/lto/pr65302_0.C: Likewise.
	* g++.dg/lto/20091002-1_0.C: Likewise.
	* g++.dg/lto/pr81940_0.C: Likewise.
	* g++.dg/lto/pr64043_0.C: Likewise.
	* g++.dg/lto/pr65549_0.C: Likewise.
	* g++.dg/lto/pr69133_0.C: Likewise.
	* gfortran.dg/lto/pr79108_0.f90: Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/sourcebuild.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/lto/20091002-1_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr64043_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr65193_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr65302_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr65316_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr65549_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr66180_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr66705_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr68057_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr69077_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr69133_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr69137_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr79000_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr81940_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr85176_0.C
    trunk/gcc/testsuite/gfortran.dg/lto/pr79108_0.f90
    trunk/gcc/testsuite/lib/target-supports.exp
Comment 14 Jakub Jelinek 2018-12-11 13:41:22 UTC
Fixed.