From: jason Date: Wed, 27 Oct 2010 15:47:52 +0000 (+0000) Subject: * gimplify.c (gimplify_decl_expr): Handle anonymous artificial X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=6ad0b38a7dc7a62b31b79f3a1fc44ee7ac0de914;p=pf3gnuchains%2Fgcc-fork.git * gimplify.c (gimplify_decl_expr): Handle anonymous artificial variables sooner. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166004 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c5ced16ec03..09ed54e6a33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-10-27 Jason Merrill + + * gimplify.c (gimplify_decl_expr): Handle anonymous artificial + variables sooner. + 2010-10-27 Jie Zhang Maxim Kuvyrkov diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 542c2234ccb..87b57f0ebf7 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1372,6 +1372,14 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p) STACK_CHECK_MAX_VAR_SIZE) > 0)) gimplify_vla_decl (decl, seq_p); + /* Some front ends do not explicitly declare all anonymous + artificial variables. We compensate here by declaring the + variables, though it would be better if the front ends would + explicitly declare them. */ + if (!DECL_SEEN_IN_BIND_EXPR_P (decl) + && DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == NULL_TREE) + gimple_add_tmp_var (decl); + if (init && init != error_mark_node) { if (!TREE_STATIC (decl)) @@ -1386,14 +1394,6 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p) as they may contain a label address. */ walk_tree (&init, force_labels_r, NULL, NULL); } - - /* Some front ends do not explicitly declare all anonymous - artificial variables. We compensate here by declaring the - variables, though it would be better if the front ends would - explicitly declare them. */ - if (!DECL_SEEN_IN_BIND_EXPR_P (decl) - && DECL_ARTIFICIAL (decl) && DECL_NAME (decl) == NULL_TREE) - gimple_add_tmp_var (decl); } return GS_ALL_DONE;