There is no way to specify a constraint for an operand of an asm statement that
may only be a destination operand (ie. the first operand of the st insn).  If
you try to use the "m" constraint together with the %P operand modifier you can
get invalid asm code when %P expands to a register instead of a number.  For
example, the Linux kernel uses this asm statement:

asm volatile ("\n[1:]\tst"#n" %1=%r2%P1\t// %0 gets overwritten by exception
handler\n"
              "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n"
              "[1:]"
              : "=r"(__pu_r8) : "m"(__m(addr)), "rO"(val), "0"(__pu_r8));

Occassionally you'll get an assembler error because the POST_MODIFY is expanded
into a register.


-- 
           Summary: No constraint letter for destination_operand
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schwab at suse dot de
GCC target triplet: ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24961

Reply via email to