This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31236] incorrect output on external symbol address cast as integer used in conditional statement
- From: "sh-list at ssc-studios dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2007 17:31:19 -0000
- Subject: [Bug c/31236] incorrect output on external symbol address cast as integer used in conditional statement
- References: <bug-31236-14260@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from sh-list at ssc-studios dot com 2007-03-17 17:31 -------
so in other words you're saying the solution to this is
"if you want it to work with GCC, make your code non-portable"
afaik "__attribute__ (( weak ))" is not part of the standard, its not a
portable solution.
the fact that
#define SOMEVALUE ((int)&SomeLinkerScriptDefinedSymbol)
int i = SOMEVALUE;
if(i == 0){
and
if(SOMEVALUE == 0){
give a different result makes gcc act inconsistently on code that should be
equivalent.
what are the real-life speed and size gains of this optimization?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31236