[Bug plugins/61311] New: missing LTO/WPA serialization API for use by regular IPA passes implemented in a plugin

pageexec at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun May 25 20:34:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61311

            Bug ID: 61311
           Summary: missing LTO/WPA serialization API for use by regular
                    IPA passes implemented in a plugin
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: plugins
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pageexec at gmail dot com

I recently faced the problem of implementing the four summary read/write
callbacks for an IPA pass in a plugin. It turned out that the high level APIs
for creating the input/output streams (e.g., create_output_block) expect 'enum
lto_section_type' (instead of, say, a string). Given that this enum obviously
cannot be expanded without patching the compiler itself, using the
serialization API from a plugin requires some code duplication to avoid calling
lto_get_section_name() deep down and the manual construction of the ELF section
name. Given that the enum isn't used for much else but to look up the basic
section name in lto_section_name[] and some statistics gathering, I think its
use for constructing the streams (and in particular the section name) should be
deprecated and instead plugins (and even in-tree users) should just be able to
provide their part of the section name as a simple string instead.

The second problem is the usual case of missing headers, I had to manually
install the following ones for gcc 4.9:

gcc/lto-streamer.h
gcc/gcov-io.h
gcc/data-streamer.h
gcc/lto-compress.h
gcc/lto/lto.h
<build_dir>/gcc/gcov-iov.h



More information about the Gcc-bugs mailing list