The following is a legal LLVM function, but it causes the CWriter to crash. It is not clear how to transform this into legal C code. declare sbyte* %llvm.va_start() declare void %llvm.va_end(sbyte*) void %test(...) { %P = call sbyte* %llvm.va_start() call void %llvm.va_end(sbyte* %P) ret void }
It's important to note that no LLVM code produced by the C or C++ frontends can directly have this. It can only be triggered in two ways: 1. LLVM code written by hand (like the testcase) 2. Optimizations which build new functions or remove arguments could cause this. W.R.T case #2, the dead argument elimination pass (which is the only one which could trigger the bug) now has an explicit hack to work around this (it does not delete all of the fixed arguments to a varargs function). Because of this, I'm reducing the severity of the bug to "minor". -Chris
I'm reducing this to 'enhancement', because there is no way to implement this with ANSI C. Perhaps there are some extensions to some compiler that could be used to implement this, but I don't think GCC has them. -Chris
Changing all of these bugs who do not have people looking at them to be assigned to "unassignedbugs", indicating that if someone is feeling ambitious, they can take ownership of the bug. If I stole your bug, and you still want it, feel free to take ownership back. -Chris
I'm closing this bug, as there is no way to fix it. This is just a limitation of C. -Chris