The attached patch replaces the uses of TREE_NO_WARNING in the LTO
front end. The streaming support doesn't extend to multiple bits yet.
I plan to do that in a follow-up change.
Add support for per-location warning groups.
gcc/lto/ChangeLog:
* gimple-streamer-out.c (output_gimple_stmt): Same.
* lto-common.c (compare_tree_sccs_1): Expand use of TREE_NO_WARNING.
* lto-streamer-out.c (hash_tree): Same.
* tree-streamer-in.c (unpack_ts_base_value_fields): Same.
* tree-streamer-out.c (pack_ts_base_value_fields): Same.
diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c
index fcbf92300d4..ae382665218 100644
--- a/gcc/gimple-streamer-out.c
+++ b/gcc/gimple-streamer-out.c
@@ -73,7 +73,7 @@ output_gimple_stmt (struct output_block *ob, struct function *fn, gimple *stmt)
/* Emit the tuple header. */
bp = bitpack_create (ob->main_stream);
bp_pack_var_len_unsigned (&bp, gimple_num_ops (stmt));
- bp_pack_value (&bp, gimple_no_warning_p (stmt), 1);
+ bp_pack_value (&bp, get_no_warning (stmt), 1);
if (is_gimple_assign (stmt))
bp_pack_value (&bp,
gimple_assign_nontemporal_move_p (
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index 02d16f49c11..4f78c90effb 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -1110,8 +1110,8 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map)
compare_values (TYPE_UNSIGNED);
if (TYPE_P (t1))
compare_values (TYPE_ARTIFICIAL);
- else
- compare_values (TREE_NO_WARNING);
+ else if (t1->base.nowarning_flag != t2->base.nowarning_flag)
+ return false;
compare_values (TREE_NOTHROW);
compare_values (TREE_STATIC);
if (code != TREE_BINFO)
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index a26d4885800..7fecb958efa 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1207,7 +1207,7 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map<tree, hashval_t> *map,
if (TYPE_P (t))
hstate.add_flag (TYPE_ARTIFICIAL (t));
else
- hstate.add_flag (TREE_NO_WARNING (t));
+ hstate.add_flag (get_no_warning (t));
hstate.add_flag (TREE_NOTHROW (t));
hstate.add_flag (TREE_STATIC (t));
hstate.add_flag (TREE_PROTECTED (t));
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index 984b1e269cf..fab7c678dae 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -131,7 +131,8 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
if (TYPE_P (expr))
TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
else
- TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
+ /* FIXME: set all warning bits. */
+ set_no_warning (expr, (unsigned) bp_unpack_value (bp, 1));
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) != TREE_BINFO)
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index 1a43534d117..d81ff60bd68 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -104,7 +104,8 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
if (TYPE_P (expr))
bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
else
- bp_pack_value (bp, TREE_NO_WARNING (expr), 1);
+ /* FIXME: pack all warning bits. */
+ bp_pack_value (bp, get_no_warning (expr), 1);
bp_pack_value (bp, TREE_NOTHROW (expr), 1);
bp_pack_value (bp, TREE_STATIC (expr), 1);
if (TREE_CODE (expr) != TREE_BINFO)