Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 12 tasks
JohnReppy opened this issue Nov 21, 2023 · 1 comment
Closed
2 of 12 tasks
Assignees
Labels
bug Something isn't working compiler problem with compiler fixed-in-110.99.5 issues that will be fixed in the 110.99.5 version

Comments

@JohnReppy
Copy link
Contributor

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

@JohnReppy JohnReppy added bug Something isn't working compiler problem with compiler labels Nov 21, 2023
@JohnReppy JohnReppy self-assigned this Nov 21, 2023
JohnReppy added a commit that referenced this issue Nov 21, 2023
@JohnReppy JohnReppy changed the title The Word literal 0wx80000000 is incorrectly converted to 0wx7FFFFFFF80000000 The word literal 0wx80000000 is incorrectly converted to 0wx7FFFFFFF80000000 Nov 21, 2023
@JohnReppy JohnReppy added the fixed-in-110.99.5 issues that will be fixed in the 110.99.5 version label Nov 21, 2023
@JohnReppy
Copy link
Contributor Author

A fix for 110.99.5 has been pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler problem with compiler fixed-in-110.99.5 issues that will be fixed in the 110.99.5 version
Projects
None yet
Development

No branches or pull requests

1 participant