This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33629] bad code with -O2 if pointer dereference followed by null test
- From: "david_albert at axiometric dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Oct 2007 18:24:43 -0000
- Subject: [Bug c/33629] bad code with -O2 if pointer dereference followed by null test
- References: <bug-33629-15181@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from david_albert at axiometric dot com 2007-10-02 18:24 -------
There is a compiler flag to prevent this optimization:
-fno-delete-null-pointer-checks
This flag should be included by default for popular targets such as the ARM7
that do not have hardware memory managers so that gcc does not by default
generate code that silently fails.
--
david_albert at axiometric dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |david_albert at axiometric
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33629