Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CWriter doesn't support zero arg vararg functions #428

Closed
lattner opened this issue Oct 23, 2003 · 6 comments
Closed

CWriter doesn't support zero arg vararg functions #428

lattner opened this issue Oct 23, 2003 · 6 comments
Labels

Comments

@lattner
Copy link
Collaborator

@lattner lattner commented Oct 23, 2003

Bugzilla Link 56
Resolution WONTFIX
Resolved on Feb 22, 2010 12:42
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#1052
CC @lattner

Extended Description

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
}

@lattner
Copy link
Collaborator Author

@lattner lattner commented Oct 24, 2003

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

@lattner
Copy link
Collaborator Author

@lattner lattner commented Feb 21, 2004

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

@lattner
Copy link
Collaborator Author

@lattner lattner commented Feb 26, 2004

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

2 similar comments
@lattner
Copy link
Collaborator Author

@lattner lattner commented Feb 26, 2004

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

@lattner
Copy link
Collaborator Author

@lattner lattner commented Feb 26, 2004

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

@lattner
Copy link
Collaborator Author

@lattner lattner commented May 2, 2006

I'm closing this bug, as there is no way to fix it. This is just a limitation of C.

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 1, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants