aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-10-31 11:04:47 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-10-31 11:04:47 +0100
commit6773658a809fbebcdb68483cb929207150ac7e5f (patch)
treec9817b2d821102662da597e911e8cc2ab92d9092 /gcc/lto
parent1297712fb4af6c6bfd827e0f0a9695b14669f87d (diff)
downloadgcc-6773658a809fbebcdb68483cb929207150ac7e5f.zip
gcc-6773658a809fbebcdb68483cb929207150ac7e5f.tar.gz
gcc-6773658a809fbebcdb68483cb929207150ac7e5f.tar.bz2
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
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-lang.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index a20e2d4..d5c1373 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p
+ on *node that is not FUNCTION_DECL.
+
2019-10-30 Martin Liska <mliska@suse.cz>
PR lto/91393
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 0d781da..3e37c37 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -305,7 +305,8 @@ handle_const_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs))
{
- if (!fndecl_built_in_p (*node))
+ if (TREE_CODE (*node) != FUNCTION_DECL
+ || !fndecl_built_in_p (*node))
inform (UNKNOWN_LOCATION, "%s:%s: %E: %E", __FILE__, __func__, *node, name);
tree type = TREE_TYPE (*node);