aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-06-20 08:37:17 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-06-20 08:37:17 +0200
commitf497c16c2698e5f2ecd6a33f174982b2f826d48e (patch)
tree935957c9e37c4fe29aace1e86944da9c80ffeb83 /gcc/gimplify.c
parent6a4e56a90e3c299e0eb634611cab3d076acbe818 (diff)
downloadgcc-f497c16c2698e5f2ecd6a33f174982b2f826d48e.zip
gcc-f497c16c2698e5f2ecd6a33f174982b2f826d48e.tar.gz
gcc-f497c16c2698e5f2ecd6a33f174982b2f826d48e.tar.bz2
re PR inline-asm/32109 (ICE with inline-asm and class with destructor)
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. From-SVN: r125874
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 774af9a..01ccaf0 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)
{