https://bugs.llvm.org/show_bug.cgi?id=45918
Bug ID: 45918
Summary: Local register variables using high-byte registers
should cause a -Wgcc-compat warning
Product: new-bugs
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: josephcsi...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
Consider this C function:
char f(void) {
register char x __asm__("dh");
__asm__("movb $42, %%dh" : "=r"(x));
return x;
}
When compiled with Clang, it will return 42, as expected. However, GCC doesn't
distinguish between "dh" and "dl", so it returns whatever happened to be in %dl
instead. They don't consider this a bug
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95121) so likely won't be
changing it anytime soon. As such, we should emit a -Wgcc-compat warning for
local register variables using high-byte registers.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs