LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 56 - CWriter doesn't support zero arg vararg functions
Summary: CWriter doesn't support zero arg vararg functions
Status: RESOLVED WONTFIX
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: C (show other bugs)
Version: trunk
Hardware: All All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords: missing-feature
Depends on:
Blocks: 1052
  Show dependency tree
 
Reported: 2003-10-23 12:36 PDT by Chris Lattner
Modified: 2010-02-22 12:42 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


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 PDT
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 PDT
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 PST
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 PST
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 PST
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 PST
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 PDT
I'm closing this bug, as there is no way to fix it.   This is just a limitation of C.

-Chris