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 c/16554] compare on address of global variable always evals to non-zero


------- 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


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