From 74d82e6b688546121764363c154af4bfe2d480f1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 29 Jan 2018 20:58:23 +0000 Subject: [PATCH] compiler: don't insert write barriers if we've seen errors 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 | 2 +- gcc/go/gofrontend/wb.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index d8350f3957f..dc531240fd5 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/wb.cc b/gcc/go/gofrontend/wb.cc index c550c52d5e5..094d8ec3534 100644 --- a/gcc/go/gofrontend/wb.cc +++ b/gcc/go/gofrontend/wb.cc @@ -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); -- 2.30.2