Anonymous | Login | Signup for a new account | 2019-02-24 03:00 CET | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||
0006359 | OCaml | back end (clambda to assembly) | public | 2014-04-01 19:56 | 2015-12-11 19:26 | |||
Reporter | chambart | |||||||
Assigned To | maranget | |||||||
Priority | normal | Severity | minor | Reproducibility | always | |||
Status | closed | Resolution | fixed | |||||
Platform | OS | OS Version | ||||||
Product Version | ||||||||
Target Version | Fixed in Version | 4.02.0+dev | ||||||
Summary | 0006359: not merged equal pattern matching branches | |||||||
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. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
(0011169) garrigue (manager) 2014-04-02 04:28 |
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. |
(0011171) maranget (manager) 2014-04-02 11:20 |
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. --Luc |
(0011173) maranget (manager) 2014-04-02 15:24 |
Bug fixed in trunk. Thanks to all. --Luc |
![]() |
|||
Date Modified | Username | Field | Change |
2014-04-01 19:56 | chambart | New Issue | |
2014-04-02 04:28 | garrigue | Note Added: 0011169 | |
2014-04-02 11:20 | maranget | Note Added: 0011171 | |
2014-04-02 11:22 | maranget | Assigned To | => maranget |
2014-04-02 11:22 | maranget | Status | new => confirmed |
2014-04-02 15:23 | maranget | Status | confirmed => resolved |
2014-04-02 15:23 | maranget | Resolution | open => fixed |
2014-04-02 15:23 | maranget | Fixed in Version | => 4.02.0+dev |
2014-04-02 15:24 | maranget | Note Added: 0011173 | |
2015-12-11 19:26 | xleroy | Status | resolved => closed |
2017-02-23 16:35 | doligez | Category | OCaml backend (code generation) => Back end (clambda to assembly) |
2017-02-23 16:44 | doligez | Category | Back end (clambda to assembly) => back end (clambda to assembly) |
Copyright © 2000 - 2011 MantisBT Group |