[llvm-bugs] [Bug 42620] New: `register` keyword with inline assembly is still needed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 15 03:09:36 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42620

            Bug ID: 42620
           Summary: `register` keyword with inline assembly is still
                    needed
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kutdanila at yandex.ru
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Hi, with C++17 `register` keyword was completely removed with its semantics.

Although, while trying to remove it from code base we faced unexpected warning
that clang produced.

E.g. 

int main() {
    int r asm ("cx") = 0;
    return r;
}

Such code will compile with a warning `ignored asm label 'cx' on automatic
variable [-Werror]`

If we add the word `register` before `int r`, it will compile without any
warning


https://gcc.godbolt.org/z/gxFa6P

I saw tests like this somewhere in test/Sema/asm.c. So my question is -- do we
actually need this keyword before the inline assembly that assigns some
register value?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190715/780d2217/attachment.html>


More information about the llvm-bugs mailing list