This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16554] compare on address of global variable always evals to non-zero
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jul 2004 23:49:55 -0000
- Subject: [Bug c/16554] compare on address of global variable always evals to non-zero
- References: <20040714232417.16554.paul_r_nash@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-07-14 23:49 -------
What's wrong with gcc's behavior? You use an extern symbol, so not
defining it at all would yield a linker error. But if you define it,
the symbol has an address, and that address must be non-zero, a fact
that gcc can use when it eliminated if-then clauses because it already
knows the value of the if-expression.
This is a duplicate of a good number of other PRs.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16554