This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.4 optimisation of if (&ptr == NULL)
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: "John Neil" <jneil at atrove dot com>
- Cc: <gcc at gcc dot gnu dot org>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Wed, 3 Dec 2003 17:49:17 -0800
- Subject: Re: GCC 3.4 optimisation of if (&ptr == NULL)
- References: <000001c3ba06$275dba90$0100a8c0@RICHO>
On Dec 3, 2003, at 17:30, John Neil wrote:
I recently spent time upgrading my embedded application form gcc 3.2
to the
current cvs version of gcc 3.4. Whilst doing this I found that gcc
3.4 was
removing the "if (&ptr == NULL) as shown in the following test case
extern void* g_ptr;
What you want is to mark the variable as weak otherwise GCC assumes the
address is not
0.
Thanks,
Andrew Pinski