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

            Bug ID: 59615
           Summary: "asm goto" output or at least clobbered operands
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hpa at zytor dot com

There are a number of uses of "asm goto" which requires at least on dyadic
architectures like x86 the ability to clobber an operand.  However, the current
definition of "asm goto" doesn't allow any output operands, and the clobber
list only works on specific registers (which are generally not allowed to be
inputs, anyway.)

For example:

    asm goto("add %1,%0 ; "
         "jc %l[t_err] ; "
         "cmp %2,%0 ; "
             "ja %l[t_err] ; "
         : "+r" (addr)
                 : "g" (size), "g" (limit)
         : : t_err);
    return false;
t_err:
    return true;

This is part of a proposed implementation of access_ok(), a limit test with a
guard for wraparound, used heavily in the Linux kernel.  There needs to be a
way to communicate to gcc that "addr" is clobbered by the first instruction.

Reply via email to