This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/13768] [3.4/3.5 Regression] -funit-at-a-time compiles unused inline function


------- Additional Comments From bangerth at dealii dot org  2004-01-20 17:18 -------
Here is a reduced testcase: 
--------------------------- 
template <typename T> struct X { 
    virtual void foo() const { 
      T::foo(1); 
    } 
}; 
 
template<typename T> 
void bar(T v) { 
  throw X<T>(); 
} 
 
inline void bar() { 
  bar(1); 
} 
--------------------------------- 
The testcase is illegal, since there is no int::foo function, but we 
get this: 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc -funit-at-a-time 
x.cc: In member function `void X<T>::foo() const [with T = int]': 
x.cc:13:   instantiated from here 
x.cc:3: error: `foo' is not a member of `int' 
 
In other words, with -funit-at-a-time, gcc tries to lay down a copy of 
bar(), where it doesn't do that without that flag. Since there is no 
reason to do that, this is a bug, I guess. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |optimization
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-20 17:18:22
               date|                            |
            Summary|[3.4/3.5 Regression] syntax |[3.4/3.5 Regression] -funit-
                   |error only when -funit-at-a-|at-a-time compiles unused
                   |time                        |inline function


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]