Skip to content

Program does not terminate when compiled with -ssa-passes minimal #630

@nanikamado

Description

@nanikamado
$ cat test.sml
print "ok\n"
$ mlton -verbose 1 test.sml
MLton 20251030.021344-g61baac710 starting
   Compile SML starting
   Compile SML finished in 1.59 + 0.57 (26% GC)
   Compile and Assemble starting
      cc -c -I/home/mado/mlton_latest/lib/mlton/targets/self/include \
          -std=gnu11 -fno-common -O1 -fno-strict-aliasing \
          -foptimize-sibling-calls -w \
          -I/home/mado/mlton_latest/lib/mlton/include -m64 -o \
          /tmp/fileNXmxXy.o /tmp/fileEUR4bT.1.c
      cc -c -m64 -o /tmp/file6XGccd.o /tmp/file5JDfWA.0.s
   Compile and Assemble finished in 0.07 + 0.00 (0% GC)
   Link starting
      cc -o test /tmp/fileNXmxXy.o /tmp/file6XGccd.o \
          -L/home/mado/mlton_latest/lib/mlton/targets/self -lmlton -lgdtoa \
          -lm -lgmp -m64 -Wl,-znoexecstack
   Link finished in 0.02 + 0.00 (0% GC)
MLton 20251030.021344-g61baac710 finished in 1.68 + 0.57 (25% GC)
$ ./test
ok
$ mlton -verbose 1 -ssa-passes minimal test.sml
MLton 20251030.021344-g61baac710 starting
   Compile SML starting
   Compile SML finished in 2.34 + 0.74 (24% GC)
   Compile and Assemble starting
      cc -c -I/home/mado/mlton_latest/lib/mlton/targets/self/include \
          -std=gnu11 -fno-common -O1 -fno-strict-aliasing \
          -foptimize-sibling-calls -w \
          -I/home/mado/mlton_latest/lib/mlton/include -m64 -o \
          /tmp/fileTnDEsr.o /tmp/fileSHlP0N.3.c
      cc -c -m64 -o /tmp/filewa6FBv.o /tmp/fileF5ohaH.2.s
      cc -c -m64 -o /tmp/file29IFo3.o /tmp/file1tXAZL.1.s
      cc -c -m64 -o /tmp/fileWJ1NMO.o /tmp/fileYeOlFF.0.s
   Compile and Assemble finished in 0.14 + 0.00 (0% GC)
   Link starting
      cc -o test /tmp/fileTnDEsr.o /tmp/filewa6FBv.o /tmp/file29IFo3.o \
          /tmp/fileWJ1NMO.o -L/home/mado/mlton_latest/lib/mlton/targets/self \
          -lmlton -lgdtoa -lm -lgmp -m64 -Wl,-znoexecstack
   Link finished in 0.03 + 0.00 (0% GC)
MLton 20251030.021344-g61baac710 finished in 2.52 + 0.74 (23% GC)
$ ./test
(does not terminate)

Environment:

System:
  Kernel: 6.17.8-200.fc42.x86_64 arch: x86_64 bits: 64
  Desktop: GNOME v: 48.6 Distro: Fedora Linux 42 (Workstation Edition)
CPU:
  Info: 6-core AMD Ryzen 5 5625U with Radeon Graphics [MT MCP] speed (MHz):
    avg: 1111 min/max: 423/4390

Is this a bug, or am I using the compiler incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions