diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-13 12:05:27 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-13 12:05:27 +0000 |
commit | fc0c4d51cf1f12bd90bc98829961fa57f23f6806 (patch) | |
tree | 3d05814c131d0a75d48d9673832203b3d531b7e4 /gcc/gimplify.c | |
parent | 77d9b6619715b88e442e0894792a9d94ccd2aaef (diff) | |
download | gcc-fc0c4d51cf1f12bd90bc98829961fa57f23f6806.tar.gz |
2012-01-13 Richard Guenther <rguenther@suse.de>
PR middle-end/8081
* gimplify.c (gimplify_modify_expr_rhs): For calls with a
variable-sized result always use RSO.
* gcc.dg/torture/pr8081.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 94b99a11823..99ae5ee4bc5 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4417,6 +4417,11 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, /* It's OK to use the target directly if it's being initialized. */ use_target = true; + else if (variably_modified_type_p (TREE_TYPE (*to_p), NULL_TREE)) + /* Always use the target and thus RSO for variable-sized types. + GIMPLE cannot deal with a variable-sized assignment + embedded in a call statement. */ + use_target = true; else if (TREE_CODE (*to_p) != SSA_NAME && (!is_gimple_variable (*to_p) || needs_to_live_in_memory (*to_p))) |