aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-backend.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-01-14 03:27:32 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-14 03:27:32 +0000
commit3dac68b99e0aa1503c2743f70e67a84401002a45 (patch)
tree01bf0d7874de7304a90a873d92d8904544ec31c7 /gcc/go/go-backend.c
parent632469d01e0652c465f9074d2ec7f5de1cb7dac9 (diff)
downloadgcc-3dac68b99e0aa1503c2743f70e67a84401002a45.zip
gcc-3dac68b99e0aa1503c2743f70e67a84401002a45.tar.gz
gcc-3dac68b99e0aa1503c2743f70e67a84401002a45.tar.bz2
Move clearing of flag_strict_aliasing to gcc interface.
From-SVN: r168774
Diffstat (limited to 'gcc/go/go-backend.c')
-rw-r--r--gcc/go/go-backend.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/go/go-backend.c b/gcc/go/go-backend.c
index 9ffe38a..5ecc99b 100644
--- a/gcc/go/go-backend.c
+++ b/gcc/go/go-backend.c
@@ -1,5 +1,5 @@
/* go-backend.c -- Go frontend interface to gcc backend.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,9 +20,11 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tree.h"
#include "tm.h"
+#include "rtl.h"
+#include "tree.h"
#include "tm_p.h"
+#include "target.h"
#include "go-c.h"
@@ -70,3 +72,22 @@ go_trampoline_info (unsigned int *size, unsigned int *alignment)
*size = TRAMPOLINE_SIZE;
*alignment = TRAMPOLINE_ALIGNMENT;
}
+
+/* This is called by the Go frontend proper if the unsafe package was
+ imported. When that happens we can not do type-based alias
+ analysis. */
+
+void
+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 ();
+}