Commit c6b36348 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/89503 (Checking ICE in 'gcc.dg/warn-strlen-no-nul.c')

	PR middle-end/89503
	* fold-const.c (fold_checksum_tree): Ignore TREE_NO_WARNING bit
	on DECL_P and EXPR_P.

From-SVN: r269303
parent d7a700e0
2019-03-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89503
* fold-const.c (fold_checksum_tree): Ignore TREE_NO_WARNING bit
on DECL_P and EXPR_P.
2019-03-01 Richard Biener <rguenther@suse.de> 2019-03-01 Richard Biener <rguenther@suse.de>
PR middle-end/89497 PR middle-end/89497
......
...@@ -12130,6 +12130,7 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx, ...@@ -12130,6 +12130,7 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx,
memcpy ((char *) &buf, expr, tree_size (expr)); memcpy ((char *) &buf, expr, tree_size (expr));
SET_DECL_ASSEMBLER_NAME ((tree)&buf, NULL); SET_DECL_ASSEMBLER_NAME ((tree)&buf, NULL);
buf.decl_with_vis.symtab_node = NULL; buf.decl_with_vis.symtab_node = NULL;
buf.base.nowarning_flag = 0;
expr = (tree) &buf; expr = (tree) &buf;
} }
else if (TREE_CODE_CLASS (code) == tcc_type else if (TREE_CODE_CLASS (code) == tcc_type
...@@ -12155,6 +12156,14 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx, ...@@ -12155,6 +12156,14 @@ fold_checksum_tree (const_tree expr, struct md5_ctx *ctx,
TYPE_CACHED_VALUES (tmp) = NULL; TYPE_CACHED_VALUES (tmp) = NULL;
} }
} }
else if (TREE_NO_WARNING (expr) && (DECL_P (expr) || EXPR_P (expr)))
{
/* Allow TREE_NO_WARNING to be set. Perhaps we shouldn't allow that
and change builtins.c etc. instead - see PR89543. */
memcpy ((char *) &buf, expr, tree_size (expr));
buf.base.nowarning_flag = 0;
expr = (tree) &buf;
}
md5_process_bytes (expr, tree_size (expr), ctx); md5_process_bytes (expr, tree_size (expr), ctx);
if (CODE_CONTAINS_STRUCT (code, TS_TYPED)) if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
fold_checksum_tree (TREE_TYPE (expr), ctx, ht); fold_checksum_tree (TREE_TYPE (expr), ctx, ht);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment