aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2019-11-06 09:08:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-06 09:08:39 +0100
commit5f6705b7b57c0461766f784d6d495986163692bb (patch)
tree8599cb1c9c49a0d79201ce71e4f7fdb570486bae /gcc/gimplify.c
parent8adf3cc4c30c0bc62a94fe8f13d5e97ee086e387 (diff)
downloadgcc-5f6705b7b57c0461766f784d6d495986163692bb.zip
gcc-5f6705b7b57c0461766f784d6d495986163692bb.tar.gz
gcc-5f6705b7b57c0461766f784d6d495986163692bb.tar.bz2
re PR inline-asm/92352 (ICE in force_constant_size)
PR inline-asm/92352 * gimplify.c (gimplify_asm_expr): Reject VLA in output or input operands with non-memory constraints. * c-c++-common/pr92352.c: New test. From-SVN: r277873
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d06b3ce..8feb246 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6235,8 +6235,13 @@ 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 we can't make copies, we can only accept memory.
+ Similarly for VLAs. */
+ tree outtype = TREE_TYPE (TREE_VALUE (link));
+ if (outtype != error_mark_node
+ && (TREE_ADDRESSABLE (outtype)
+ || !COMPLETE_TYPE_P (outtype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (outtype))))
{
if (allows_mem)
allows_reg = 0;
@@ -6392,7 +6397,11 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
oconstraints, &allows_mem, &allows_reg);
/* If we can't make copies, we can only accept memory. */
- if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (link))))
+ tree intype = TREE_TYPE (TREE_VALUE (link));
+ if (intype != error_mark_node
+ && (TREE_ADDRESSABLE (intype)
+ || !COMPLETE_TYPE_P (intype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (intype))))
{
if (allows_mem)
allows_reg = 0;