From 6773658a809fbebcdb68483cb929207150ac7e5f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 31 Oct 2019 11:04:47 +0100 Subject: re PR middle-end/92231 (ICE in gimple_fold_stmt_to_constant_1) PR middle-end/92231 * tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of DECL_BUILT_IN in comment. Remove redundant ()s around return argument. * tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL before calling fndecl_built_in_p. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling fndecl_built_in_p on it. lto/ * lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p on *node that is not FUNCTION_DECL. testsuite/ * gcc.c-torture/compile/pr92231.c: New test. From-SVN: r277660 --- gcc/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index 3866804..741f7a2 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5805,7 +5805,8 @@ free_lang_data_in_decl (tree decl, class free_lang_data_d *fld) while (*nextp) { tree var = *nextp; - if (fndecl_built_in_p (var)) + if (TREE_CODE (var) == FUNCTION_DECL + && fndecl_built_in_p (var)) *nextp = TREE_CHAIN (var); else nextp = &TREE_CHAIN (var); -- cgit v1.1