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

switch lowering infinitely loops, chews memory. #1569

Closed
llvmbot opened this issue Feb 13, 2007 · 6 comments
Closed

switch lowering infinitely loops, chews memory. #1569

llvmbot opened this issue Feb 13, 2007 · 6 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm:codegen

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 13, 2007

Bugzilla Link 1197
Resolution FIXED
Resolved on Feb 22, 2010 12:51
Version 1.9
OS All
Attachments [bytecode obtained by compiling gcchttps://user-images.githubusercontent.com/60944935/143736866-416634fd-b471-4691-b179-dd378ee95df1.gz), bugpoint reduced bytecode
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

The following llvm bytecode file causes llc
to eat up all memory on my machine then die.
To reproduce, run as follows:
llc exp_attr.bc
This is not x86 specific, since
llc -march=ppc32 exp_attr.bc
also uses up vast (maybe infinite) amounts
of memory. However the C backend works ok.
I'll attach the bytecode file in a second.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 13, 2007

assigned to @lattner

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 13, 2007

@lattner
Copy link
Collaborator

lattner commented Feb 13, 2007

testing a patch

@lattner
Copy link
Collaborator

lattner commented Feb 13, 2007

Fixed. Testcase here: test/CodeGen/Generic/switch-lower.ll

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

-Chris

@asl
Copy link
Collaborator

asl commented Feb 21, 2007

switch lowering is still broken somehow.

Consider the folowing code:

define i32 @​main(i32 %argc, i8** %argv) {
old_entry1:
br label %cond_next
cond_next:
%not.tmp14 = icmp slt i32 %argc, 11
%hvar2 = zext i1 %not.tmp14 to i32
switch i32 %hvar2, label %old_entry [
i32 -2, label %cond_true
i32 -1, label %cond_next
i32 0, label %cond_true15
i32 1, label %cond_next22
]
cond_true15:
ret i32 1
cond_true:
ret i32 2
cond_next22:
ret i32 3
old_entry:
ret i32 4
}

(Yes, I know, that cases -1 and -2 are really dead).

Resulting binary will always produce result code 4. Commenting out "-1" and "-2"
cases will fix the problem.

@lattner
Copy link
Collaborator

lattner commented Feb 24, 2007

Moving new bug to a new bugzilla: Bug 1219.

The original issue is fixed.

-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 compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm:codegen
Projects
None yet
Development

No branches or pull requests

3 participants