diff options
author | Jason Merrill <jason@redhat.com> | 2004-10-31 04:17:40 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2004-10-31 04:17:40 -0500 |
commit | 49382b6cf985a8a8b586ff04ee035e824be6a048 (patch) | |
tree | 2d12083f41fcd0c8a8b307416d7a1abbc45f3c68 /gcc/tree-gimple.c | |
parent | 16b34ad6620d4c6c692bdc5c739ba4241987d346 (diff) | |
download | gcc-49382b6cf985a8a8b586ff04ee035e824be6a048.zip gcc-49382b6cf985a8a8b586ff04ee035e824be6a048.tar.gz gcc-49382b6cf985a8a8b586ff04ee035e824be6a048.tar.bz2 |
re PR middle-end/17526 (libcpp is miscompiled with -fno-pcc-struct-return -O2)
PR middle-end/17526
* tree-gimple.c (is_gimple_mem_rhs): Also require a val for
aggregate types that are not BLKmode.
From-SVN: r89915
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r-- | gcc/tree-gimple.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index 84005aad..4a31c0e 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -111,9 +111,12 @@ is_gimple_reg_rhs (tree t) bool is_gimple_mem_rhs (tree t) { - /* If we're dealing with a renamable type, either source or dest - must be a renamed variable. */ - if (is_gimple_reg_type (TREE_TYPE (t))) + /* If we're dealing with a renamable type, either source or dest must be + a renamed variable. Also force a temporary if the type doesn't need + to be stored in memory, since it's cheap and prevents erroneous + tailcalls (PR 17526). */ + if (is_gimple_reg_type (TREE_TYPE (t)) + || TYPE_MODE (TREE_TYPE (t)) != BLKmode) return is_gimple_val (t); else return is_gimple_formal_tmp_rhs (t); |