lang.c (java_init_options_struct): Disable optimizations which assume a NULL pointer...
authorJeffrey A Law <law@cygnus.com>
Wed, 23 Nov 2011 17:37:01 +0000 (17:37 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 23 Nov 2011 17:37:01 +0000 (10:37 -0700)
* lang.c (java_init_options_struct): Disable optimizations
which assume a NULL pointer dereference will cause a fault.

From-SVN: r181674

gcc/java/ChangeLog
gcc/java/lang.c

index 27a44f11f7d40998c9f441918071d4b08e4ea0e0..e6d8db3a88644270eedd15927f557f1645779834 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-23  Jeffrey A Law  (law@cygnus.com)
+
+       * lang.c (java_init_options_struct): Disable optimizations
+       which assume a NULL pointer dereference will cause a fault.
+
 2011-11-07  Richard Henderson  <rth@redhat.com>
 
        * builtins.c (compareAndSwapInt_builtin): Use can_compare_and_swap_p.
index 6a117d79fcceedad8c441558ce09dd0900c50770..ccab48c4e7adc70a31c3b385a37ce7e26e0348d3 100644 (file)
@@ -556,6 +556,10 @@ java_init_options_struct (struct gcc_options *opts)
 
   /* Java requires left-to-right evaluation of subexpressions.  */
   opts->x_flag_evaluation_order = 1;
+
+  /* Java catches NULL pointer exceptions, thus we can not necessarily
+     rely on a pointer having a non-NULL value after a dereference.  */
+  opts->x_flag_delete_null_pointer_checks = 0;
 }
 
 static void