+2012-12-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55619
+ * semantics.c (finish_asm_stmt): Don't call decay_conversion
+ on input operands that can be only in memory.
+
2012-12-10 Eric Botcazou <ebotcazou@adacore.com>
* Make-lang.in (cp/typeck.o): Add dependency on $(PARAMS_H).
for (i = 0, t = input_operands; t; ++i, t = TREE_CHAIN (t))
{
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
- operand = decay_conversion (TREE_VALUE (t), tf_warning_or_error);
+ bool constraint_parsed
+ = parse_input_constraint (&constraint, i, ninputs, noutputs, 0,
+ oconstraints, &allows_mem, &allows_reg);
+ /* If the operand is going to end up in memory, don't call
+ decay_conversion. */
+ if (constraint_parsed && !allows_reg && allows_mem)
+ operand = mark_lvalue_use (TREE_VALUE (t));
+ else
+ operand = decay_conversion (TREE_VALUE (t), tf_warning_or_error);
/* If the type of the operand hasn't been determined (e.g.,
because it involves an overloaded function), then issue
operand = error_mark_node;
}
- if (parse_input_constraint (&constraint, i, ninputs, noutputs, 0,
- oconstraints, &allows_mem, &allows_reg))
+ if (constraint_parsed)
{
/* If the operand is going to end up in memory,
mark it addressable. */
2012-12-11 Jakub Jelinek <jakub@redhat.com>
+ PR c++/55619
+ * g++.dg/ext/asm12.C: New test.
+
PR tree-optimization/54570
* gcc.dg/builtin-object-size-8.c: Xfail.
* gcc.dg/builtin-object-size-13.c: New test.
--- /dev/null
+// PR c++/55619
+// { dg-do compile }
+
+typedef int V __attribute__ ((vector_size (4 * sizeof (int))));
+
+static const V C = { 0x201, 0, 0, 0 };
+static const int D = 0x201;
+
+void
+f ()
+{
+ __asm volatile ("" : : "m" (C));
+ __asm volatile ("" : : "m" (D));
+}