public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14950] New: always_inline does not mix with templates and -O0
@ 2004-04-14  8:06 veksler at il dot ibm dot com
  2004-04-23  0:21 ` [Bug c++/14950] [3.4 Regression] [non unit-at-a-time] " pinskia at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 21+ messages in thread
From: veksler at il dot ibm dot com @ 2004-04-14  8:06 UTC (permalink / raw)
  To: gcc-bugs

The following does not compile with -O0, but does with -O2. It used to
work well on gcc-3.2 and gcc-3.1

  $  cat t.cc
  template <class T> inline void Foo(T) __attribute__((always_inline));
  template <class T> inline void Foo(T) {}
  int main() 
  {
     int i; 
     Foo(i); 
  }
  $ $gcc34/bin/g++ -c t.cc
  t.cc: In function `int main()':
  t.cc:2: sorry, unimplemented: inlining failed in call to 'void Foo(T) 
[with T = int]': function body not available
  t.cc:6: sorry, unimplemented: called from here

When compiled with -O, it works OK. When the same is done without 
templates it works OK:

  $ cat t2.cc
  inline void Foo(int) __attribute__((always_inline));
  inline void Foo(int) {}
  int main()
  {
    int i;
    Foo(i);
  }

This is inconsistent.

  $ $gcc34/bin/g++ -v
  Reading specs from /home/veksler/gcc/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
  Configured with: ../gcc-3.4.0-20040406/configure --prefix=/home/veksler/gcc
--enable-languages=c++
  Thread model: posix
  gcc version 3.4.0 20040407 (prerelease)

-- 
           Summary: always_inline does not mix with templates and -O0
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: veksler at il dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2006-01-22  3:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-14950-2544@http.gcc.gnu.org/bugzilla/>
2005-10-07  3:17 ` [Bug c++/14950] [3.4 Regression] [non unit-at-a-time] always_inline does not mix with templates and -O0 gdr at gcc dot gnu dot org
2006-01-22  3:00 ` gdr at gcc dot gnu dot org
2006-01-22  3:13 ` gdr at gcc dot gnu dot org
2004-04-14  8:06 [Bug c++/14950] New: " veksler at il dot ibm dot com
2004-04-23  0:21 ` [Bug c++/14950] [3.4 Regression] [non unit-at-a-time] " pinskia at gcc dot gnu dot org
2004-05-05 20:21 ` hubicka at gcc dot gnu dot org
2004-05-06  4:10 ` adam at yggdrasil dot com
2004-05-06  6:28 ` adam at yggdrasil dot com
2004-05-06 11:38 ` pinskia at gcc dot gnu dot org
2004-06-22 10:36 ` cvs-commit at gcc dot gnu dot org
2004-06-22 15:39 ` pinskia at gcc dot gnu dot org
2004-10-13 11:23 ` veksler at il dot ibm dot com
2004-10-13 11:34 ` pinskia at gcc dot gnu dot org
2004-10-31  2:43 ` mmitchel at gcc dot gnu dot org
2005-01-26 16:22 ` jeanmichel dot gilbert at videotron dot ca
2005-01-26 16:24 ` jeanmichel dot gilbert at videotron dot ca
2005-02-12 23:18 ` pinskia at gcc dot gnu dot org
2005-02-12 23:19 ` pinskia at gcc dot gnu dot org
2005-03-02  6:53 ` pinskia at gcc dot gnu dot org
2005-03-06 15:10 ` pinskia at gcc dot gnu dot org
2005-05-19 17:39 ` mmitchel at gcc dot gnu dot org
2005-08-22 20:55 ` pinskia at gcc dot gnu dot 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).