File 1434-compiler-Remove-dead-code-from-alias-analysis-pass.patch of Package erlang

From 7679273b0b63139adba5d6d5165b2c8c629d3761 Mon Sep 17 00:00:00 2001
From: Frej Drejhammar <frej.drejhammar@gmail.com>
Date: Fri, 3 May 2024 06:48:48 +0200
Subject: [PATCH 4/4] compiler: Remove dead code from alias analysis pass

Remove an explicit error case in the alias analysis pass which
currently is the only uncovered line in the coverage report for the
pass. During development it was helpful to have a clear-text exit
instead of a match failure when an unknown instruction was
encountered, but now as the code has matured, it is only noise in the
coverage report. Therefore remove it, as, if a new ssa instruction is
added, it will be obvious from the error message what the problem is.
---
 lib/compiler/src/beam_ssa_alias.erl | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/compiler/src/beam_ssa_alias.erl b/lib/compiler/src/beam_ssa_alias.erl
index 1789b99da8..ddaff864f5 100644
--- a/lib/compiler/src/beam_ssa_alias.erl
+++ b/lib/compiler/src/beam_ssa_alias.erl
@@ -419,9 +419,9 @@ aa_is([_I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0,
 aa_blocks([], _Kills, Lbl2SS, AAS, _ForcedAliases) ->
     {Lbl2SS,AAS}.
 
-aa_is([I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0,
+aa_is([_I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0,
       AAS0, ForcedAliases) ->
-    ?DP("I: ~p~n", [I]),
+    ?DP("I: ~p~n", [_I]),
     SS1 = beam_ssa_ss:add_var(Dst, unique, SS0),
     {SS3, AAS} =
         case Op of
@@ -572,9 +572,7 @@ aa_is([_I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0,
             resume ->
                 {SS1, AAS0};
             wait_timeout ->
-                {SS1, AAS0};
-            _ ->
-                exit({unknown_instruction, I})
+                {SS1, AAS0}
         end,
     SS = case sets:is_element(Dst, ForcedAliases) of
              true ->
@@ -582,7 +580,7 @@ aa_is([_I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0,
              false ->
                  SS3
          end,
-    ?DP("Post I: ~p.~n      ~p~n", [I, SS]),
+    ?DP("Post I: ~p.~n      ~p~n", [_I, SS]),
     aa_is(Is, SS, AAS, ForcedAliases);
 aa_is([], SS, AAS, _ForcedAliases) ->
     {SS, AAS}.
-- 
2.35.3

openSUSE Build Service is sponsored by