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

Sometimes AsmPrinter::PrintSpecial assigns the same uid for two Machine Instructions #1550

Closed
llvmbot opened this issue Feb 5, 2007 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla llvm:codegen miscompilation

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 5, 2007

Bugzilla Link 1178
Resolution FIXED
Resolved on Feb 22, 2010 12:55
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

The code:
void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) {
[...]
} else if (!strcmp(Code, "uid")) {
// Assign a unique ID to this machine instruction.
static const MachineInstr *LastMI = 0;
static unsigned Counter = 0U-1;
// If this is a new machine instruction, bump the counter.
if (LastMI != MI) { ++Counter; LastMI = MI; }
O << Counter;
} else {
[...]
}


Comparison (LastMI != MI) is incorrect. Machine Instructions of different
Machine Functions can have the same address.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 5, 2007

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Feb 5, 2007

This patch should fix this:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070205/043978.html

With no testcase, I can't tell for sure though. Please reopen if this isn't enough to fix the issue.

Thanks!

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
troelsbjerre pushed a commit to troelsbjerre/llvm-project that referenced this issue Jan 10, 2024
…ds_objc_creating_ast

Fix how we handle bit-fields for Objective-C when creating an AST
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:codegen miscompilation
Projects
None yet
Development

No branches or pull requests

2 participants