===================================================================
@@ -14091,6 +14091,13 @@ ix86_print_operand (FILE *file, rtx x, int code)
return;
case 'H':
+ if (!offsettable_memref_p (x))
+ {
+ output_operand_lossage ("operand is not an offsettable memory "
+ "reference, invalid operand "
+ "code 'H'");
+ return;
+ }
/* It doesn't actually matter what mode we use here, as we're
only going to use this for printing. */
x = adjust_address_nv (x, DImode, 8);
===================================================================
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+void foo (int a)
+{
+ asm volatile ("# %H0" : : "r" (a)); /* { dg-error "not an offsettable" } */
+}