diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-20 06:37:17 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-20 06:37:17 +0000 |
commit | a36f02c9e188c04d2315cb54004b69f97feab24f (patch) | |
tree | 935957c9e37c4fe29aace1e86944da9c80ffeb83 /gcc/gimplify.c | |
parent | c5dc094f1ed6cfd3cf5770b2eeace9639f79df57 (diff) | |
download | gcc-a36f02c9e188c04d2315cb54004b69f97feab24f.tar.gz |
PR inline-asm/32109
* gimplify.c (gimplify_asm_expr): Issue error if type is addressable
and !allows_mem.
* g++.dg/ext/asm10.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125874 138bc75d-0d04-0410-961f-82ee72b054a4
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 774af9adbf8..01ccaf02a82 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4122,6 +4122,19 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p) parse_input_constraint (&constraint, 0, 0, noutputs, 0, oconstraints, &allows_mem, &allows_reg); + /* 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 input %d must stay in memory", i); + return GS_ERROR; + } + } + /* If the operand is a memory input, it should be an lvalue. */ if (!allows_reg && allows_mem) { |