[Bug c++/33607] -O2 optimisation causes null pointer exception at runtime when calling g++ from java using jni

2007-10-01 Thread mattias dot ellert at tsl dot uu dot se
--- Comment #1 from mattias dot ellert at tsl dot uu dot se 2007-10-01 08:41 --- Created an attachment (id=14277) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14277&action=view) The test case... This is the test case used above. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?i

[Bug c++/33607] -O2 optimisation causes null pointer exception at runtime when calling g++ from java using jni

2007-10-01 Thread tromey 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:

[Bug c++/33607] -O2 optimisation causes null pointer exception at runtime when calling g++ from java using jni

2007-10-02 Thread mattias dot ellert at tsl dot uu dot se
--- Comment #3 from mattias dot ellert at tsl dot uu dot se 2007-10-02 07:52 --- (In reply to comment #2) Thanks for taking your time to reply. Using -fno-strict-aliasing works for me too. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33607