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

inlining-related compiler crash #6770

Closed
vicuna opened this issue Feb 3, 2015 · 2 comments
Closed

inlining-related compiler crash #6770

vicuna opened this issue Feb 3, 2015 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Feb 3, 2015

Original bug ID: 6770
Reporter: @damiendoligez
Assigned to: @mshinwell
Status: closed (set by @mshinwell on 2015-02-04T08:07:50Z)
Resolution: open
Priority: normal
Severity: major
Version: 4.03.0+dev / +beta1
Target version: 4.02.2+dev / +rc1
Category: back end (clambda to assembly)
Duplicate of: #6686

Bug description

When you compile the attached file with ocamlopt and any inlining level greater than 1, you get a compiler crash with the following message:

Fatal error: Selection.emit_expr: unbound var match_1020
Fatal error: exception Misc.Fatal_error

I tracked it down to commit 14444 from March 2014.

Note: the problem disappears as soon as you remove one or both of the "ignore" lines.

Steps to reproduce

cat >problems.ml <<EOF
type t =
| Constant of float
| Exponent of (float * float)

let to_string = function
| Exponent (_b, _e) ->
ignore _b;
ignore _e;
""
| Constant _ -> ""

let _ = to_string (Constant 4.)
EOF

ocamlopt -inline 20 problems.ml

File attachments

@vicuna
Copy link
Author

vicuna commented Feb 4, 2015

Comment author: @mshinwell

Is this related to #6686 ?
(I'll merge the patch for that soon unless anyone objects.)

@vicuna
Copy link
Author

vicuna commented Feb 4, 2015

Comment author: @mshinwell

I checked that this is the same issue. See #6686.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants