You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6359 Reporter:@chambart Assigned to:@maranget Status: closed (set by @xavierleroy on 2015-12-11T18:26:28Z) Resolution: fixed Priority: normal Severity: minor Fixed in version: 4.02.0+dev Category: back end (clambda to assembly) Monitored by:@gasche
Bug description
In the following example (extracted from ocamlnet), the fields extractions of n and g for cases A and D are not merged.
This is not strictly speaking a bug since it does not impact anything,
but I would like to assume that identifiers can't be bound multiple times
(in my backend patches) and this is the only case I know (in the opam
repository) where this don't hold.
The text was updated successfully, but these errors were encountered:
Multiple binding of the same identifier is a bug: there are already parts of the backend where this invariant is assumed, and I have generated wrong code by just breaking it.
Whether to merge the branches or not is another question.
This is indeed a bug, and it is related to sharing!
(The match compiler re-shares actions which are alpha-equivalent
but this sharing is lost in the case for instance of variants.
Original bug ID: 6359
Reporter: @chambart
Assigned to: @maranget
Status: closed (set by @xavierleroy on 2015-12-11T18:26:28Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.02.0+dev
Category: back end (clambda to assembly)
Monitored by: @gasche
Bug description
In the following example (extracted from ocamlnet), the fields extractions of n and g for cases
A and
D are not merged.match
C with |
A(n,g)| `D(n,g) -> n + g
| _ -> 0
In the resulting lambda
ocamlc -c -drawlambda example.ml
(setglobal Example!
(seq
(let (match/1012 67a)
(catch
(catch
(if (isint match/1012) (exit 2)
(let (variant/1019 (field 0 match/1012))
(if (!= variant/1019 65)
(if (!= variant/1019 68) (exit 2)
(let
(match/1017 (field 1 match/1012)
g/1016 (field 1 match/1017)
n/1015 (field 0 match/1017))
(exit 1 n/1015 g/1016)))
(let
(match/1017 (field 1 match/1012)
g/1016 (field 1 match/1017)
n/1015 (field 0 match/1017))
(exit 1 n/1015 g/1016)))))
with (2) 0)
with (1 n/1008 g/1009) (+ n/1008 g/1009)))
(makeblock 0)))
This is not strictly speaking a bug since it does not impact anything,
but I would like to assume that identifiers can't be bound multiple times
(in my backend patches) and this is the only case I know (in the opam
repository) where this don't hold.
The text was updated successfully, but these errors were encountered: