summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-26 06:43:38 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-26 06:43:38 +0000
commit3a3a9294b46c9123a47aff180e23baaf3aff81d2 (patch)
tree2520ac26865bc1af84763e99c2d1e79b0100e56d /gcc/cfgexpand.c
parent358d075385f327d85935e798a91deff571091ab7 (diff)
downloadgcc-3a3a9294b46c9123a47aff180e23baaf3aff81d2.tar.gz
2010-03-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 157741 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@157742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index fcae897a392..a797af9a167 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -77,8 +77,12 @@ gimple_assign_rhs_to_tree (gimple stmt)
{
t = gimple_assign_rhs1 (stmt);
/* Avoid modifying this tree in place below. */
- if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t)
- && gimple_location (stmt) != EXPR_LOCATION (t))
+ if ((gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t)
+ && gimple_location (stmt) != EXPR_LOCATION (t))
+ || (gimple_block (stmt)
+ && currently_expanding_to_rtl
+ && EXPR_P (t)
+ && gimple_block (stmt) != TREE_BLOCK (t)))
t = copy_node (t);
}
else
@@ -86,6 +90,8 @@ gimple_assign_rhs_to_tree (gimple stmt)
if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, gimple_location (stmt));
+ if (gimple_block (stmt) && currently_expanding_to_rtl && EXPR_P (t))
+ TREE_BLOCK (t) = gimple_block (stmt);
return t;
}