-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
This code when compiled with clang -g -O1 -fsanitize=kernel-address -c x.c
void m();
void *memcpy(void *a, void *b, unsigned long c) {return 0;}
typedef struct {
int a;
int c;
} d;
typedef struct {
d f;
int g;
} h;
typedef struct {
d f;
h g;
} i;
void j() { memcpy(0, 0, 0); }
struct i *e;
int k(i l) {
i b;
b.g = l.g;
e = &b;
m();
return 0;
}
i o;
int n() {
k(o);
return 0;
}
produces
inlinable function call in a function with debug info must have a !dbg location
%18 = call ptr @memcpy(ptr %4, ptr @o, i64 20)
inlinable function call in a function with debug info must have a !dbg location
%18 = call ptr @memcpy(ptr %4, ptr @o, i64 20)
fatal error: error in backend: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
I traced it down to HandleByValArgumentInit
where newly-inserted memcpy
has no debug loc. I think we may attribute the memcpy
to some debug loc. But the general problem is that the compiler could synthesize intrinsic calls without debug loc. Maybe we should suppress the assertion for intrinsic calls?
Metadata
Metadata
Assignees
Labels
llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!