Skip to content

The word literal 0wx80000000 is incorrectly converted to 0wx7FFFFFFF80000000 #287

Description

@JohnReppy

Version

110.99.4 (Latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

No response

Processor

  • Any
  • Arm (using Rosetta)
  • PowerPC
  • Sparc
  • x86 (32-bit)
  • x86-64 (64-bit)
  • Other

System Component

Core system

Severity

Major

Description

The word literal 0wx80000000 is converted to 0wx7FFFFFFF80000000 by the compiler. This issue also affects expressions that can be compile-time evaluated to 0wx80000000 (e.g., Word.<<(0w1, 0w31)).

Transcript

Standard ML of New Jersey (64-bit) v110.99.4 [built: Tue Aug 01 16:07:38 2023]
- 0wx80000000;
val it = 0wx7FFFFFFF80000000 : word
- Word.<<(0w1, 0w31);
val it = 0wx7FFFFFFF80000000 : word
- fun lsh1 n = Word.<<(0w1, n);
val lsh1 = fn : word -> word
- lsh1 0w31;
val it = 0wx80000000 : word
- 

Expected Behavior

- 0wx80000000;
val it = 0wx80000000 : word

Steps to Reproduce

See above transcript.

Additional Information

I have isolated the problem to an off-by-one error in the CPS/main/new-literals.sml file and will push a fix.

Email address

jhr@cs.uchicago.edu

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerproblem with compilerfixed-in-110.99.5issues that will be fixed in the 110.99.5 version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions