compiler: don't insert write barriers if we've seen errors
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 29 Jan 2018 20:58:23 +0000 (20:58 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 29 Jan 2018 20:58:23 +0000 (20:58 +0000)
    The compiler skips the escape analysis pass if it has seen any errors.
    The write barrier pass, especially the check-escapes portion, relies
    on escape analysis running.  So don't run this pass if there have been
    any errors, as it may cause further unreliable error reports.

    Reviewed-on: https://go-review.googlesource.com/90575

From-SVN: r257163

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/wb.cc

index d8350f3957ffaa762f2cb99123935d88e1e50103..dc531240fd54c2421c2e3b4f665d06b4e90fc675 100644 (file)
@@ -1,4 +1,4 @@
-4164071703c531b5234b790b76df4931c37a8d9c
+6517e6731aeb4512d12c341c7111959a44547ba0
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index c550c52d5e5462c10c7a57b377f2cca5014d1dd4..094d8ec3534114c4cefd7b42f81c2f2ce86e7c4a 100644 (file)
@@ -410,6 +410,9 @@ Write_barriers::statement(Block* block, size_t* pindex, Statement* s)
 void
 Gogo::add_write_barriers()
 {
+  if (saw_errors())
+    return;
+
   Mark_address_taken mat(this);
   this->traverse(&mat);