From nobody Wed May 20 02:02:40 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gKvv44pbWz6dwj2 for ; Wed, 20 May 2026 02:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gKvv448N7z3FXh for ; Wed, 20 May 2026 02:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779242560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqO2kxVGy1DrbjqdA4Df2cfWkZU9e+YZ0DAFIFUab5g=; b=cq/1poAKP11YyF+/6tsRvnmEdYgkyJxXINbur6dc+2myB0+LJ6GvWKa/OWLxI02e4mra0F 9X18TGo+HIUJc8ZsrbFVZojqWEqwL7054xqUYuyvAzd8qMGYGCUOjiVpXQQg7BHaib/5aE jieQ3lAuxSGmHXb7E1crxMrJ1UF675a6glNa8xq92m91+NzhZDsMTXpHpCIySghiFWa2+x VEuPXFwUEOrn2wPs9ty6Wr7HXYrras155+xEig4XhRkd729JAK/atWX4yH1RvhguBfu7XL RWrPsaQNS0zQwZI02ZBfAQPzXN/+HwDDULdo5b7shtMiByh84oDL8mqEWIxOHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779242560; a=rsa-sha256; cv=none; b=pnf0owWz7aooCpOrCi1tmIUmmCdFs/kgawxe+Yf0RVV0Uxqet7m0S4mvlLkaAjoE1SQNve i79tlQsHsKZ4xvizRHLWJAbENixSlKPijBFsNRyta9HmzcRsY55XNnoKwv7BDgZFyuyesa 0AkhwNpWNqzQA3IfGIMKmSCOi4Z4i62yaFMiOex7lONhog9eV5lOU3iQO1pE/EoroTbD9l VwBsfUIS7C6c21+EvaZhtluqsyM4ImJqBfE/HkY5tCUUBXrjZHqnBbzfY8S3ZarIG4bI/i pYCb385QL8cCqBzEthXxkp5hlbxb/P0DRUR3++87lgma/7gOT6A7Sbfia2hHAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779242560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hqO2kxVGy1DrbjqdA4Df2cfWkZU9e+YZ0DAFIFUab5g=; b=jVssrm2WVUbHx679vpAE/iqeI4M5PY4QHhKksaNVWgx+mtf/v2O+a4Uof8/zSPJqJRLwaN BUHJ3LwavEnDY6BCA2jA4yYhUPNQROcwx5HN8QJdjDtOgMV02ifRtrrvkZYuSvZ51JfBFO T5dtVNk3XjfgzEcZFB+OLx0IaoB212v59ShCshULpO5fifFo8tWBa17GBa7tAvwJ5e9yHN rctJHDWEPCbD4ayAGfYPdCgynETFZw0XhCscCcFKhOcly09qe5vg5LqyPBkklUbMbsdZvn V6+7jfzn1vwMyZCo50BboJUTxkIcKiQ3KK32teH1Ndvyrz+ml7p8stayO3+wbQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4gKvv43YKkzhfX for ; Wed, 20 May 2026 02:02:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 64K22euQ009559 for ; Wed, 20 May 2026 02:02:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 64K22eiU009558 for bugs@FreeBSD.org; Wed, 20 May 2026 02:02:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 295431] CURRENT compiler miscompiles lang/mit-scheme Date: Wed, 20 May 2026 02:02:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 16.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jfc@mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D295431 Bug ID: 295431 Summary: CURRENT compiler miscompiles lang/mit-scheme Product: Base System Version: 16.0-CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: jfc@mit.edu Created attachment 270915 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D270915&action= =3Dedit llvm IR The system cc compiler on CURRENT miscompiles lang/mit-scheme for amd64. T= he attached LLVM IR file is from src/microcode/cmpint.c. Compile it -O2 -S -fno-strict-aliasing -march=3Dx86-64-v3. The assembly ou= tput for function guarantee_interp_return contains movabsq $7493989779944505344, %rcx # imm =3D 0x6800000000000000 orq %rax, %rcx movq $0, stack_pointer(%rip) movq %rcx, 0 The last line is a store to address 0, causing a runtime crash. The previo= us line is also incorrect, causing a store of NULL to an interpreter stack poi= nter that should never be NULL. That NULL value is used for the store address on the last line. Usually -fno-strict-aliasing prevents miscompilation but this time it does = the opposite. FreeBSD clang version 21.1.8 (https://github.com/llvm/llvm-project.git llvmorg-21.1.8-0-g2078da43e25a) devel/llvm21 has the same behavior. The IR is incompatible with llvm19 due= to the new "capture" keyword. That keyword is used for alias analysis. A possible clue. It's conceivable that the MIT Scheme code has undefined behavior other than aliasing. I have not had time to trace the optimization passes to see where the bad code came in. --=20 You are receiving this mail because: You are the assignee for the bug.=