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

Module compiled with no_ssa_opt cannot be loaded #7024

Closed
josevalim opened this issue Mar 16, 2023 · 1 comment
Closed

Module compiled with no_ssa_opt cannot be loaded #7024

josevalim opened this issue Mar 16, 2023 · 1 comment
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Milestone

Comments

@josevalim
Copy link
Contributor

This module:

-module(foo).
-compile(export_all).
-compile([no_ssa_opt]).
start() ->
  case 1 of
    X when hd(X) -> "Will not match";
    X -> "Got 1"
  end.

fails to be loaded:

$ erlc foo
$ erl
Erlang/OTP 26 [DEVELOPMENT] [erts-13.1.4] [source-e35cd70570] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Eshell V13.1.4 (press Ctrl+G to abort, type help(). for help)
1> foo:start().
=ERROR REPORT==== 16-Mar-2023::14:07:28.175623 ===
beam/beam_load.c(356): Error loading function foo:start/0: op get_hd: Sd:
  bad tag 1 for destination


** exception error: undefined function foo:start/0

I was able to reproduce this on Erlang/OTP 25 and Erlang/OTP 26 (as of 596fae6).

@jhogberg
Copy link
Contributor

Thanks for your report, I've fixed it in #7027 :-)

jhogberg added a commit that referenced this issue Mar 22, 2023
…18519' into maint

* john/erts/fix-hd-tl-loader-transformations/GH-7024/OTP-18519:
  jit: Fix hd/1 and tl/1 BIF specialization
@jhogberg jhogberg added this to the OTP-25.3.1 milestone Apr 14, 2023
u3s pushed a commit that referenced this issue Apr 27, 2023
…18519' into maint-25

* john/erts/fix-hd-tl-loader-transformations/GH-7024/OTP-18519:
  jit: Fix hd/1 and tl/1 BIF specialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants