Skip to content

Compiler bug: Contract: UsageMap on 132 #44

@JohnReppy

Description

@JohnReppy

Version

110.99

Operating System

  • All
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

10.15.7

Processor

x86 (32-bit)

Component

Core system

Severity

Major

Description of the problem

The following code snippet produces:
Compiler bug: Contract: UsageMap on 132.

Transcript

$ cat > valia.sml << EOF
fun g (l, a, b, x, y, d0, d1 : real, d2 : real, d3 : real) = (
    x - Real.fromInt(Array.sub(l, a));
    y - Real.fromInt(Array.sub(l, b))
)
EOF

$ sml valia.sml
Standard ML of New Jersey (64-bit) v110.99 [built: Thu Dec 24 11:47:23 2020]
[opening valia.sml]
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
Error: Compiler bug: Contract: UsageMap on 132
****** pass1 ******
 v129(v130[PV]) =
    v129("bogus")
 v101(v131[PV]) =
    v129("bogus")
 v91.1 -> v93[PV]
 v12(v103[C],v96[PR1]) =
    v1(v104[C],v80[PV],v81[I],v82[I],v83[R64],v84[R64],v86[R64],v87[R64],v133[PR2]) =
       v132.0 -> v88[R64]
       v133.0 -> v132[PF1]
       v133.1 -> v85[PV]
       length(v80) -> v46[I]
       v118(v105[I]) =
          real63_64(v105) -> v43[R64]
          length(v80) -> v59[I]
          v107(v106[I]) =
             real63_64(v106) -> v56[R64]
             subf64(v84,v56) -> v55[R64]
             v104(v55)
          if u63<(v82,v59) [v108] then
             subscript(v80,v82) -> v60[I]
             v107(v60)
          else
             {v93,(I63t)0,(I63t)0} -> v98
             v98.0 -> v110[PV]
             v98.1 -> v111[PV]
             v98.2 -> v112[PV]
             {"valia.sml:3.22-3.31",v112} -> v114
             {v110,v111,v114} -> v113
             gethdlr() -> v117[FN]
             v117(v101,v113)
       if u63<(v81,v46) [v119] then
          subscript(v80,v81) -> v47[I]
          v118(v47)
       else
          {v93,(I63t)0,(I63t)0} -> v97
          v97.0 -> v121[PV]
          v97.1 -> v122[PV]
          v97.2 -> v123[PV]
          {"valia.sml:2.22-2.31",v123} -> v125
          {v121,v122,v125} -> v124
          gethdlr() -> v128[FN]
          v128(v101,v124)
    v103(v1)
 {v12} -> v89
 v102(v89)

Expected Behavior

No response

Steps to Reproduce

fun g (l, a, b, x, y, d0, d1 : real, d2 : real, d3 : real) = (
    x - Real.fromInt(Array.sub(l, a));
    y - Real.fromInt(Array.sub(l, b))
)

Additional Information

No response

Email address

nickie@softlab.ntua.gr

Comments from smlnj-gforge

Original smlnj-gforge bug number 284

Submitted via web form by Nikolaos S. Papaspyrou nickie@softlab.ntua.gr on 2021-04-18 at 19:22:00

comment by @JohnReppy on 2022-05-31 17:04:00 +000 UTC

It looks like this bug is in the CPSTrans module (CPS/convert/cpstrans.sml), which is producing bogus CPS IR.

comment by @JohnReppy on 2022-06-01 15:58:00 +000 UTC

Fixed for 110.99.3 and 2022.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerproblem with compilerfixed-in-110.99.3issues that will be fixed in the 110.99.3 versiongforgebug (or feature request) ported from smlnj-gforge repository

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions