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 middle-end/16631] Problems inlining with enums


------- Additional Comments From bangerth at dealii dot org  2004-07-19 19:04 -------
No, the warning is _not_ correct. You don't want warnings that only 
happen during inlining if the compiler can prove, based on knowing 
argument values or value ranges, that certain parts of an inlined 
function are dead. That's a completely common case, we don't want 
to see warnings then. 
 
This is the same as if you had code like 
  void foo (int i) { 
    if (i>256) 
      do_something(); 
  } 
 
  void bar (char c) { 
    foo((int)c); 
  } 
Since the argument to foo is certainly smaller than 256, the if-branch 
is never taken and the call to do_something is dead. I can't believe we 
want a warning for that. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


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


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