From 73f397d429016727961c2c4a9ff99cf2fc4ee7b3 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 5 Jul 2005 18:50:24 +0100 Subject: re PR c/22013 (ICE in gimple_add_tmp_var, at gimplify.c:535) PR c/22013 PR c/22098 * langhooks.h (struct lang_hooks): Add expr_to_decl. * langhooks.c (lhd_expr_to_decl): New. * langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL): New. (LANG_HOOKS_INITIALIZER): Update. * tree.c (recompute_tree_invarant_for_addr_expr): Call expr_to_decl langhook. * c-tree.h (c_expr_to_decl): Declare. * c-typeck.c (c_expr_to_decl): New. (build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR specially. * c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define. testsuite: * gcc.c-torture/compile/pr22013-1.c, gcc.c-torture/execute/pr22098-1.c, gcc.c-torture/execute/pr22098-2.c, gcc.c-torture/execute/pr22098-3.c: New tests. From-SVN: r101630 --- gcc/tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index 76f52cdcb6d..60678814824 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2466,6 +2466,8 @@ do { tree _node = (NODE); \ UPDATE_TITCSE (TREE_OPERAND (node, 2)); } + node = lang_hooks.expr_to_decl (node, &tc, &ti, &se); + /* Now see what's inside. If it's an INDIRECT_REF, copy our properties from the address, since &(*a)->b is a form of addition. If it's a decl, it's invariant and constant if the decl is static. It's also invariant if it's -- cgit v1.2.1