public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/47934] New: LTO: function with attribute "used" is not emitted
@ 2011-03-01  6:45 d.g.gorbachev at gmail dot com
  2011-03-01  6:47 ` [Bug lto/47934] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-03-01  6:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47934

           Summary: LTO: function with attribute "used" is not emitted
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com


============= bug.c =============
static void __attribute__((used)) 
foo(void) 
{ 
}

int main(void)
{
  __asm__("call foo");
  return 0;
}
=================================

$ gcc -flto bug.c
/tmp/ccCtTmmT.ltrans0.ltrans.o: In function `main':
ccCtTmmT.ltrans0.o:(.text+0x4): undefined reference to `foo'
collect2: ld returned 1 exit status

>From GCC documentation:

`used'
     This attribute, attached to a function, means that code must be
     emitted for the function even if it appears that the function is
     not referenced.  This is useful, for example, when the function is
     referenced only in inline assembly.


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

end of thread, other threads:[~2011-03-01 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-01  6:45 [Bug lto/47934] New: LTO: function with attribute "used" is not emitted d.g.gorbachev at gmail dot com
2011-03-01  6:47 ` [Bug lto/47934] " pinskia at gcc dot gnu.org
2011-03-01  6:58 ` [Bug lto/47934] LTO: function with attribute "used" is emitted under the "wrong" name d.g.gorbachev at gmail dot com
2011-03-01 10:21 ` rguenth at gcc dot gnu.org

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).