[Bug lto/106129] New: [12/13 Regression] LTO option merging broken

jsm28 at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 28 22:42:14 GMT 2022


            Bug ID: 106129
           Summary: [12/13 Regression] LTO option merging broken
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

The LTO merging of options from different input files was broken by:

commit 227a2ecf663d69972b851f51f1934d18927b62cd
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Mar 12 11:53:47 2021 +0100

    lto-wrapper: Use vec<cl_decoded_option> data type.

Previously, find_and_merge_options would merge options it read into those in
*opts. After this commit, options in *opts on entry to find_and_merge_options
are ignored; the only merging that takes place is between multiple sets of
options in the same input file that are read in the same call to this function
(not sure how that case can occur at all). The effects include, for example,
that if some objects are built with PIC enabled and others with it disabled,
and the last LTO object processed has PIC enabled, the choice of PIC for the
last object will result in the whole program being built as PIC, when the
merging logic is intended to ensure that a mixture of PIC and non-PIC objects
results in the whole program being built as non-PIC.

I'm testing a patch for this bug.

More information about the Gcc-bugs mailing list