ld: Set non_ir_ref_regular on source for assignment
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Jun 2020 10:56:05 +0000 (03:56 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Jun 2020 10:56:16 +0000 (03:56 -0700)
commit5376d47f66d0e4e07b3d42cb62ad07327cad4292
treea2f4ab98b98a0cf98f62d014e7b6e7d6060fa4b6
parenta5aae5087ca50f14e361cffe155ad3886afb56cb
ld: Set non_ir_ref_regular on source for assignment

We need to set non_ir_ref_regular on the source for assignment to get
the correct LTO resolution:

190 a27be7f4ad90c5ce PREVAILING_DEF real_g

instead of

190 30c3b2d8f967f5ea PREVAILING_DEF_IRONLY real_g

PR ld/26163
* ldexp.c (exp_fold_tree_1): Set non_ir_ref_regular on the source
for assignment.
* testsuite/ld-plugin/lto.exp: Run ld/26163 test.
* testsuite/ld-plugin/pr26163a.c: New file.
* testsuite/ld-plugin/pr26163b.c: Likewise.
ld/ChangeLog
ld/ldexp.c
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/pr26163a.c [new file with mode: 0644]
ld/testsuite/ld-plugin/pr26163b.c [new file with mode: 0644]