This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/16631] Problems inlining with enums
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2004 19:04:15 -0000
- Subject: [Bug middle-end/16631] Problems inlining with enums
- References: <20040719172622.16631.roger@eyesopen.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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