aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-05-06 23:14:35 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-05-06 23:14:35 +0200
commitd5754d94e47e277a761715da3d3b93158cf179d9 (patch)
tree35adf5c4a8fa97f31b1ab2760eff5ca61a459d81 /gcc/cfgexpand.c
parenta9856a8d08902b1c11a730217a97302a92965996 (diff)
downloadgcc-d5754d94e47e277a761715da3d3b93158cf179d9.zip
gcc-d5754d94e47e277a761715da3d3b93158cf179d9.tar.gz
gcc-d5754d94e47e277a761715da3d3b93158cf179d9.tar.bz2
re PR c++/85659 (ICE with inline assembly inside virtual function)
PR c++/85659 * cfgexpand.c (expand_asm_stmt): Don't create a temporary if the type is addressable. Don't force op into register if it has BLKmode. * g++.dg/ext/asm14.C: New test. * g++.dg/ext/asm15.C: New test. * g++.dg/ext/asm16.C: New test. From-SVN: r259981
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index deab929..ff2f407 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3044,14 +3044,14 @@ expand_asm_stmt (gasm *stmt)
generating_concat_p = 0;
- if ((TREE_CODE (val) == INDIRECT_REF
- && allows_mem)
+ if ((TREE_CODE (val) == INDIRECT_REF && allows_mem)
|| (DECL_P (val)
&& (allows_mem || REG_P (DECL_RTL (val)))
&& ! (REG_P (DECL_RTL (val))
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type)))
|| ! allows_reg
- || is_inout)
+ || is_inout
+ || TREE_ADDRESSABLE (type))
{
op = expand_expr (val, NULL_RTX, VOIDmode,
!allows_reg ? EXPAND_MEMORY : EXPAND_WRITE);
@@ -3060,7 +3060,7 @@ expand_asm_stmt (gasm *stmt)
if (! allows_reg && !MEM_P (op))
error ("output number %d not directly addressable", i);
- if ((! allows_mem && MEM_P (op))
+ if ((! allows_mem && MEM_P (op) && GET_MODE (op) != BLKmode)
|| GET_CODE (op) == CONCAT)
{
rtx old_op = op;