summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-17 13:56:05 +0000
committerchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-17 13:56:05 +0000
commit4eb18c4c4b447ac0adbd294152158a51e66d1699 (patch)
treea7dc4160b85544cb435236dbef90b30ebb85fdbf
parentb55deb213a41cc84bfc47901960dc014f5412f35 (diff)
downloadgcc-4eb18c4c4b447ac0adbd294152158a51e66d1699.tar.gz
2015-12-17 Christian Bruel <christian.bruel@st.com>
* tree.h (TYPE_MODE_RAW): New macro. * tree-streamer-out.c (pack_ts_type_common_value_fields): Replace TYPE_MODE by TYPE_MODE_RAW. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231758 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-streamer-out.c5
-rw-r--r--gcc/tree.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f836652c9af..1db66d6583b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-17 Christian Bruel <christian.bruel@st.com>
+
+ * tree.h (TYPE_MODE_RAW): New macro.
+ * tree-streamer-out.c (pack_ts_type_common_value_fields):
+ Replace TYPE_MODE by TYPE_MODE_RAW.
+
2015-12-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/68835
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index bfd06449ecb..ddb7eee6ade 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -308,7 +308,10 @@ pack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
static void
pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
{
- bp_pack_machine_mode (bp, TYPE_MODE (expr));
+ /* for VECTOR_TYPE, TYPE_MODE reevaluates the mode using target_flags
+ not necessary valid in a global context.
+ Use the raw value previously set by layout_type. */
+ bp_pack_machine_mode (bp, TYPE_MODE_RAW (expr));
bp_pack_value (bp, TYPE_STRING_FLAG (expr), 1);
/* TYPE_NO_FORCE_BLK is private to stor-layout and need
no streaming. */
diff --git a/gcc/tree.h b/gcc/tree.h
index 96ffa83cdf9..5d1a77c76fc 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1793,6 +1793,7 @@ extern void protected_set_expr_location (tree, location_t);
#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.main_variant)
#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type_common.context)
+#define TYPE_MODE_RAW(NODE) (TYPE_CHECK (NODE)->type_common.mode)
#define TYPE_MODE(NODE) \
(VECTOR_TYPE_P (TYPE_CHECK (NODE)) \
? vector_type_mode (NODE) : (NODE)->type_common.mode)