bool ok;
size_t constraint_len;
+ if (error_operand_p (TREE_VALUE (link)))
+ return GS_ERROR;
link_next = TREE_CHAIN (link);
oconstraints[i]
/* 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 (TREE_ADDRESSABLE (outtype)
+ || !COMPLETE_TYPE_P (outtype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (outtype)))
{
if (allows_mem)
allows_reg = 0;
int input_num = 0;
for (link = ASM_INPUTS (expr); link; ++input_num, ++i, link = link_next)
{
+ if (error_operand_p (TREE_VALUE (link)))
+ return GS_ERROR;
link_next = TREE_CHAIN (link);
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
reg_info.operand = TREE_VALUE (link);
/* If we can't make copies, we can only accept memory. */
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 (TREE_ADDRESSABLE (intype)
+ || !COMPLETE_TYPE_P (intype)
+ || !tree_fits_poly_uint64_p (TYPE_SIZE_UNIT (intype)))
{
if (allows_mem)
allows_reg = 0;
--- /dev/null
+/* { dg-do compile { target aarch64*-*-* arm*-*-* powerpc*-*-* s390*-*-* x86_64-*-* } } */
+
+/* For the non existing variable we are faced with an error mark node during
+ gimplify_asm_expr(). */
+
+void test (void)
+{
+ __asm__ __volatile__ ("" : "={2}" (non_existing_var)); /* { dg-error {'non_existing_var' undeclared} } */
+}
--- /dev/null
+/* { dg-do compile { target aarch64*-*-* arm*-*-* powerpc*-*-* s390*-*-* x86_64-*-* } } */
+
+/* For the non existing variable we are faced with an error mark node during
+ gimplify_asm_expr(). */
+
+void test (void)
+{
+ __asm__ __volatile__ ("" :: "{2}" (non_existing_var)); /* { dg-error {'non_existing_var' undeclared} } */
+}