Open imaandrew opened 4 months ago
@llvm/issue-subscribers-backend-mips
Author: Andrew (imaandrew)
Sorry, I did not reproduce this issue. Could you give more complete reproduce code? Thanks!
Both of these source files crash for me
void func(const char* x, ...) {}
#include <stdarg.h>
int add(int n, ...) {
va_list args;
int i, sum = 0;
va_start (args, n);
for (i = 0; i < n; i++) {
sum += va_arg (args, int);
}
va_end (args);
return sum;
}
These commands give the above error:
clang -target mips-linux-gnu -march=mips3 -mabi=o32 -c test.c
clang -target mips-linux-gnu -march=mips3 -c test.c
These commands compile without crashing:
clang -target mips-linux-gnu -march=mips3 -mabi=n32 -c test.c
clang -target mips-linux-gnu -march=mips3 -mabi=n64 -c test.c
clang -target mips-linux-gnu -c test.c
I got a reduced .bc file from bugpoint for each of the examples I provided and have attached them below bugpoint.zip
Thanks for your reply, now I can reproduce the issue. And I would do research.
When compiling any variadic function with options
-target mips-linux-gnu -march=mips3
, clang will crash and produce the following backtrace:Example file:
This crash does not happen when using the n32/n64 ABIs, only the default o32 ABI