The write barrier pass depends on the escape analysis pass, and we
don't run the escape analysis pass if we've seen any errors.  Running
the write barrier pass without the escape analysis pass can produce
incorrect errors.  So skip it.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 257126)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -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: gcc/go/gofrontend/wb.cc
===================================================================
--- gcc/go/gofrontend/wb.cc     (revision 257113)
+++ gcc/go/gofrontend/wb.cc     (working copy)
@@ -410,6 +410,9 @@ Write_barriers::statement(Block* block,
 void
 Gogo::add_write_barriers()
 {
+  if (saw_errors())
+    return;
+
   Mark_address_taken mat(this);
   this->traverse(&mat);
 

Reply via email to