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

Cranelift: hit unreachable case while lowering fcvt_to_uint #4693

Closed
elliottt opened this issue Aug 11, 2022 · 2 comments
Closed

Cranelift: hit unreachable case while lowering fcvt_to_uint #4693

elliottt opened this issue Aug 11, 2022 · 2 comments
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator

Comments

@elliottt
Copy link
Member

.clif Test Case

function %f13(f32x4) -> i32x4 {                                                      
block0(v0: f32x4):                                                                   
  v1 = fcvt_to_uint.i32x4 v0                                                         
  return v1                                                                          
} 

Steps to Reproduce

Compiling this causes an unreachable case to be reached:

// Since this branch is also guarded by a check for vector types
// neither Opcode::FcvtToUint nor Opcode::FcvtToSint can reach here
// due to vector varients not existing. The first two branches will
// cover all reachable cases.
unreachable!();

Expected Results

Either an error or a successful compilation.

Actual Results

Panic

Versions and Environment

Cranelift version or commit: 0c2e049

Operating system: linux

Architecture: x86_64

@elliottt elliottt added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator labels Aug 11, 2022
@jlb6740
Copy link
Contributor

jlb6740 commented Aug 11, 2022

Hi @elliottt . Does this unreachable case get hit before patch #4684 ?
I have not tried, but the comments here say this unreachable is guarded by both the Opcode::FcvtToUnit and Opcode::FcvtToSint. It looks like 4864 removed one of those branches and if so I wondering if that patch (removing that code) introduced the possibility of this fall through?

@elliottt
Copy link
Member Author

elliottt commented Aug 11, 2022

I hit the panic at c4fd6a9, which is the direct parent of #4684. This panic is from fcvt_to_uint, vs fcvt_from_uint which was ported to ISLE in #4684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

2 participants