This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33607] -O2 optimisation causes null pointer exception at runtime when calling g++ from java using jni
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2007 18:32:54 -0000
- Subject: [Bug c++/33607] -O2 optimisation causes null pointer exception at runtime when calling g++ from java using jni
- References: <bug-33607-11224@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from tromey at gcc dot gnu dot org 2007-10-01 18:32 -------
The SWIG code violates strict aliasing rules.
Try adding -Wstrict-aliasing and you will see what I mean.
If I add -fno-strict-aliasing to the -O2 case, it works.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33607