In http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02019.html I added code to call init_varasm_once again if a package imports unsafe. As that message explains, this is to avoid an assert in mems_in_disjoint_alias_sets_p if it sees a non-zero alias set when flag_strict_aliasing is false. However, I tested removing the call to init_varasm_once in the current compiler, and the assert never triggers. This appears to be because the alias set allocate in init_varasm_once is only used for constant memory addresses (MEM_READONLY_P). The patch http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01758.html fixed canon_true_dependence so that it gets out quickly for a MEM_READONLY_P address. So as far as I can tell const_alias_set is no longer used for anything, so it is no longer necessary to reinitialize it to avoid the assert.
This patch avoids the call to init_varasm_once and lets me remove the #include of the backend-only rtl.h from the frontend go-backend.c. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2013-07-23 Ian Lance Taylor <i...@google.com> * go-backend.c: Don't #include "rtl.h". (go_imported_unsafe): Don't call init_varasm_once. * Make-lang.in (go/go-backend.o): Don't depend on $(RTL_H).
Index: Make-lang.in =================================================================== --- Make-lang.in (revision 201171) +++ Make-lang.in (working copy) @@ -240,7 +240,7 @@ GO_RUNTIME_H = go/gofrontend/runtime.h g GO_AST_DUMP_H = go/gofrontend/ast-dump.h go/gofrontend/string-dump.h go/go-backend.o: go/go-backend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) output.h $(TARGET_H) \ + $(TM_H) $(TREE_H) $(TM_P_H) output.h $(TARGET_H) \ $(COMMON_TARGET_H) CFLAGS-go/go-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \ Index: go-backend.c =================================================================== --- go-backend.c (revision 200210) +++ go-backend.c (working copy) @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. #include "coretypes.h" #include "simple-object.h" #include "tm.h" -#include "rtl.h" #include "tree.h" #include "tm_p.h" #include "intl.h" @@ -91,12 +90,6 @@ go_imported_unsafe (void) { flag_strict_aliasing = false; - /* This is a real hack. init_varasm_once has already grabbed an - alias set, which we don't want when we aren't doing strict - aliasing. We reinitialize to make it do it again. This should - be OK in practice since we haven't really done anything yet. */ - init_varasm_once (); - /* Let the backend know that the options have changed. */ targetm.override_options_after_change (); }