Bug 56 - CWriter doesn't support zero arg vararg functions
: CWriter doesn't support zero arg vararg functions
Status: RESOLVED WONTFIX
Product: libraries
Classification: Unclassified
Component: Backend: C
: trunk
: All All
: P enhancement
Assigned To: Unassigned LLVM Bugs
:
: missing-feature
:
: 1052
  Show dependency treegraph
 
Reported: 2003-10-23 12:36 CDT by Chris Lattner
Modified: 2010-02-22 12:42 CST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2003-10-23 12:36:45 CDT
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
}
Comment 1 Chris Lattner 2003-10-23 22:51:33 CDT
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
Comment 2 Chris Lattner 2004-02-20 16:41:01 CST
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
Comment 3 Chris Lattner 2004-02-26 15:31:26 CST
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
Comment 4 Chris Lattner 2004-02-26 15:32:05 CST
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
Comment 5 Chris Lattner 2004-02-26 15:35:30 CST
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
Comment 6 Chris Lattner 2006-05-02 11:34:47 CDT
I'm closing this bug, as there is no way to fix it.   This is just a limitation
of C.

-Chris