public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/101382] New: function declarations with identical asm label aliasing a target function does not compile with -flto
@ 2021-07-09  0:31 fabian.parzefall at mailbox dot org
  2021-07-09  7:16 ` [Bug ipa/101382] " rguenth at gcc dot gnu.org
  2021-07-29 19:51 ` fparzefall at pjrcorp dot com
  0 siblings, 2 replies; 3+ messages in thread
From: fabian.parzefall at mailbox dot org @ 2021-07-09  0:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101382
           Summary: function declarations with identical asm label
                    aliasing a target function does not compile with -flto
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fabian.parzefall at mailbox dot org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51120
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51120&action=edit
Input reproducing the bug

GCC cannot compile a module containing two function declarations with the same
asm label and the same alias attribute when -flto is enabled. Here is an
excerpt from the attachment:

    void a(void) { ... }
    extern typeof(a) b asm("x") __attribute__((alias("a")));
    extern typeof(a) c asm("x") __attribute__((alias("a")));

When compiling with:

    gcc -flto -c -o gcc-lto-asm-label-bug.o gcc-lto-asm-label-bug.c
    gcc -flto -o gcc-lto-asm-label-bug gcc-lto-asm-label-bug.o

The second command invoked produces this error message:

    lto1: fatal error: missing resolution data for *x
    compilation terminated.
    lto-wrapper: fatal error: gcc returned 1 exit status
    compilation terminated.
    /usr/bin/ld: error: lto-wrapper failed
    collect2: error: ld returned 1 exit status

Compiling without -flto works as expected. GCC versions tested are 9.3.0 and
11.1.0 on Ubuntu 20.04.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-29 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09  0:31 [Bug lto/101382] New: function declarations with identical asm label aliasing a target function does not compile with -flto fabian.parzefall at mailbox dot org
2021-07-09  7:16 ` [Bug ipa/101382] " rguenth at gcc dot gnu.org
2021-07-29 19:51 ` fparzefall at pjrcorp dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).