[llvm-bugs] [Bug 41417] New: stack-protector-strong: Bad machine code: Using an undefined physical register
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Apr 7 09:38:22 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41417
Bug ID: 41417
Summary: stack-protector-strong: Bad machine code: Using an
undefined physical register
Product: new-bugs
Version: trunk
Hardware: Other
OS: FreeBSD
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: dimitry at andric.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
As reported in https://bugs.freebsd.org/237074, the multimedia/vlc3 port fails
to build for armv6 with a fatal backend error:
[... lots of stuff ... ]
*** Bad machine code: Using an undefined physical register ***
- function: AVI_ChunkRead
- basic block: %bb.11 if.then13 (0x804066b68)
- instruction: TCRETURNri %22:tcgpr, implicit $sp, implicit $r0, implicit
killed $r1
- operand 2: implicit $r0
*** Bad machine code: Using an undefined physical register ***
- function: AVI_ChunkRead
- basic block: %bb.11 if.then13 (0x804066b68)
- instruction: TCRETURNri %22:tcgpr, implicit $sp, implicit $r0, implicit
killed $r1
- operand 3: implicit killed $r1
fatal error: error in backend: Found 2 machine code errors.
Minimized test case:
// clang -cc1 -triple armv6kz---gnueabihf -S -target-cpu arm1176jzf-s -O2
-stack-protector 2 libavi-min.c
void c(_Bool *);
void a() {
_Bool b;
c(&b);
}
const struct {
int d;
int (*e)();
} f[] = {};
int h(void);
int AVI_ChunkRead_p_chk() {
int g = h();
if (g)
return f[g].e(0, 0);
a();
return 0;
}
Using -stack-protector 1, or lowering the optimization level to -O1 makes it
work again.
Also, if you add (int, int) to the 'e' member of the struct, like so:
const struct {
int d;
int (*e)(int, int);
} f[] = {};
it works. So maybe this is related to C varargs functions.
--
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/20190407/51f4909b/attachment.html>
More information about the llvm-bugs
mailing list