diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-03-19 09:11:25 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-03-19 09:11:25 +0100 |
commit | edff2a0574bfab8c35737ae1b4514ec3e18c4c96 (patch) | |
tree | 32a9049d66717a59377ced4a235b43f0f9b6ce62 /gcc/gimplify.c | |
parent | 4f683506df6ae4137d5cd362ccb8a50302cf8a2d (diff) | |
download | gcc-edff2a0574bfab8c35737ae1b4514ec3e18c4c96.zip gcc-edff2a0574bfab8c35737ae1b4514ec3e18c4c96.tar.gz gcc-edff2a0574bfab8c35737ae1b4514ec3e18c4c96.tar.bz2 |
re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
PR target/89752
* gimplify.c (gimplify_asm_expr): For output argument with
TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
diagnose error.
* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
* g++.dg/ext/asm16.C: Likewise.
* g++.dg/ext/asm17.C: New test.
From-SVN: r269793
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 6d7a314..e264700 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6155,6 +6155,19 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) is_inout = false; } + /* If we can't make copies, we can only accept memory. */ + if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link)))) + { + if (allows_mem) + allows_reg = 0; + else + { + error ("impossible constraint in %<asm%>"); + error ("non-memory output %d must stay in memory", i); + return GS_ERROR; + } + } + if (!allows_reg && allows_mem) mark_addressable (TREE_VALUE (link)); |