go-lang.c (go_langhook_post_options): If -fisolate-erroneous-paths was turned on...
authorIan Lance Taylor <iant@google.com>
Wed, 6 Nov 2013 15:14:28 +0000 (15:14 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 6 Nov 2013 15:14:28 +0000 (15:14 +0000)
* go-lang.c (go_langhook_post_options): If
-fisolate-erroneous-paths was turned on by an optimization option,
turn it off.

From-SVN: r204459

gcc/go/ChangeLog
gcc/go/go-lang.c

index 70f34968d92627b3a62de2ba06e9211ee8305784..33ccc1cdce898beecc1ad4957da5c39181cac8a2 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-06  Ian Lance Taylor  <iant@google.com>
+
+       * go-lang.c (go_langhook_post_options): If
+       -fisolate-erroneous-paths was turned on by an optimization option,
+       turn it off.
+
 2013-10-14  Chris Manghane  <cmang@google.com>
 
        * go-gcc.cc (Gcc_backend::address_expression): New function.
index 37d61d1f5d734b9884c4feb6ec9c289bbb62ed1b..14080f098c8b375d4eb9cf7e35d14a8d5afc4eeb 100644 (file)
@@ -268,6 +268,12 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
   if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
     flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
 
+  /* The isolate_erroneous_paths optimization can change a nil
+     dereference from a panic to a trap, so we have to disable it for
+     Go, even though it is normally enabled by -O2.  */
+  if (!global_options_set.x_flag_isolate_erroneous_paths)
+    global_options.x_flag_isolate_erroneous_paths = 0;
+
   /* Returning false means that the backend should be used.  */
   return false;
 }