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

parameter attributes assigned to wrong argument #1885

Closed
llvmbot opened this issue Jun 15, 2007 · 3 comments
Closed

parameter attributes assigned to wrong argument #1885

llvmbot opened this issue Jun 15, 2007 · 3 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag miscompilation

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 15, 2007

Bugzilla Link 1513
Resolution FIXED
Resolved on Feb 22, 2010 12:48
Version trunk
OS Linux
Attachments hack that fixes this particular problem
Reporter LLVM Bugzilla Contributor

Extended Description

consider the function

struct long s{
long a;
long b;
}

void f(struct s, char *, char);

In x86_64 the struct s is passed in registers, so the llvm type should be

f(i64, i64, i8 *, i8 sext)

The problem is that in TypeConvert::ConvertFunctionType, the Idx is only
incremented by one when passing by the first (C) argument. Because of this the
llvm type generated is invalid:

f(i64, i64, i8 * sext, i8)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 15, 2007

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Jun 18, 2007

I'm taking a look. You're right, the attribute code should be in the abiconverter stuff. This is a good time
for me to audit the attribute creation stuff in the front-end. I'll see if I can merge the loops etc.

@lattner
Copy link
Collaborator

lattner commented Jun 19, 2007

Fixed. Testcase here: CFrontend/2007-06-18-SextAttrAggregate.c

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070618/050591.html

Thanks Rafael!

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag miscompilation
Projects
None yet
Development

No branches or pull requests

2 participants