External Issue: [Bug]:

27733, "kant2002", "[Bug]:", "2025-08-30T07:33:09Z"

Summary of Problem

Description:
I did try to build programs from GitHub - greensoftwarelab/Energy-Languages: The complete set of tools for energy consumption analysis of programming languages, using Computer Language Benchmark Game and when building with clang I receive following error.

binarytrees.chpl:75: internal error: RES-FUN-ION-2804 chpl version 2.5.0\nNote: This source location is a guess.\

Is this issue currently blocking your progress?
No

Steps to Reproduce

Source Code:

/* The Computer Language Benchmarks Game
   http://benchmarksgame.alioth.debian.org/

   contributed by Casey Battaglino, Ben Harshbarger, and Brad Chamberlain
   derived from the GNU C version by Jeremy Zerfas
*/


use DynamicIters;

config const n = 10;         // the maximum tree depth

proc main() {
  const minDepth = 4,                      // the shallowest tree
        maxDepth = max(minDepth + 2, n),   // the deepest normal tree
        strDepth = maxDepth + 1,           // the depth of the "stretch" tree
        depths = minDepth..maxDepth by 2;  // the range of depths to create
  var stats: [depths] (int,int);           // stores statistics for the trees

  //
  // Create the "stretch" tree, checksum it, print its stats, and free it.
  //
  const strTree = new Tree(strDepth);
  writeln("stretch tree of depth ", strDepth, "\t check: ", strTree.sum());
  delete strTree;

  //
  // Build the long-lived tree.
  //
  const llTree = new Tree(maxDepth);

  //
  // Iterate over the depths in parallel, dynamically assigning them
  // to tasks.  At each depth, create the required trees, compute
  // their sums, and free them.
  //
  forall depth in dynamic(depths, chunkSize=1) {
    const iterations = 2**(maxDepth - depth + minDepth);
    var sum = 0;
			
    for i in 1..iterations {
      const t = new Tree(depth);
      sum += t.sum();
      delete t;
    }
    stats[depth] = (iterations, sum);
  }

  //
  // Print out the stats for the trees of varying depths.
  //
  for depth in depths do
    writeln(stats[depth](1), "\t trees of depth ", depth, "\t check: ",
            stats[depth](2));

  //
  // Checksum the long-lived tree, print its stats, and free it.
  //
  writeln("long lived tree of depth ", maxDepth, "\t check: ", llTree.sum());
  delete llTree;
}


//
// A simple balanced tree node class
//
class Tree {
  var left, right: Tree;

  //
  // A Tree-building initializer
  //
  proc init(depth) {
    if depth > 0 {
      left  = new Tree(depth-1);
      right = new Tree(depth-1);
    }
  }

  //
  // Add up tree node, freeing as we go
  //
  proc sum(): int {
    var sum = 1;
    if left {
      sum += left.sum() + right.sum();
      delete left;
      delete right;
    }
    return sum;
  }
}

Compile command:

Execution command:

Associated Future Test(s):

Configuration Information

  • Output of chpl --version: chpl version 2.5.0
    built with LLVM version 18.1.3
    available LLVM targets: xtensa, m68k, xcore, x86-64, x86, wasm64, wasm32, ve, systemz, sparcel, sparcv9, sparc, riscv64, riscv32, ppc64le, ppc64, ppc32le, ppc32, nvptx64, nvptx, msp430, mips64el, mips64, mipsel, mips, loongarch64, loongarch32, lanai, hexagon, bpfeb, bpfel, bpf, avr, thumbeb, thumb, armeb, arm, amdgcn, r600, aarch64_32, aarch64_be, aarch64, arm64_32, arm64

  • Output of $CHPL_HOME/util/printchplenv --anonymize:

CHPL_HOME: /usr/share/chapel/2.5
CHPL_RUNTIME_LIB: /usr/lib/chapel/2.5/runtime/lib
CHPL_RUNTIME_INCL: /usr/lib/chapel/2.5/runtime/include
CHPL_THIRD_PARTY: /usr/lib/chapel/2.5/third-party

machine info: Linux pkrvmccyg1gnepe 6.11.0-1018-azure #18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025 x86_64
CHPL_HOME: /usr/share/chapel/2.5 *
script location: /usr/share/chapel/2.5/util/chplenv
CHPL_HOST_PLATFORM: linux64
CHPL_HOST_COMPILER: clang
CHPL_HOST_CC: clang
CHPL_HOST_CXX: clang++
CHPL_HOST_ARCH: x86_64
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm *
CHPL_TARGET_CC: /usr/lib/llvm-18/bin/clang --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/13
CHPL_TARGET_CXX: /usr/lib/llvm-18/bin/clang++ --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/13
CHPL_TARGET_LD: /usr/lib/llvm-18/bin/clang++ --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/13
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: none +
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_HOST_MEM: jemalloc
CHPL_HOST_JEMALLOC: bundled
CHPL_TARGET_MEM: jemalloc
CHPL_TARGET_JEMALLOC: bundled
CHPL_ATOMICS: cstdlib
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_HWLOC_PCI: disable
CHPL_RE2: bundled
CHPL_LLVM: system
CHPL_LLVM_SUPPORT: system
CHPL_LLVM_CONFIG: llvm-config-18
CHPL_LLVM_VERSION: 18
CHPL_AUX_FILESYS: none
CHPL_LIB_PIC: none
CHPL_SANITIZE: none
CHPL_SANITIZE_EXE: none