Ticket #612 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

value doesn't match constraint :S32CONST in template for CCL::ADD-CONSTANT

Reported by: emarsden Owned by: rme
Priority: normal Milestone: Clozure CL 1.4
Component: Compiler Version: trunk
Keywords: Cc:

Description

Welcome to Clozure Common Lisp Version 1.4-dev-r13065M  (LinuxX8664)!
? (LAMBDA (A B)
    (DECLARE (OPTIMIZE (SAFETY 2) (SPEED 1)))
    (+ (LOAD-TIME-VALUE -14930786 T) 1826522792 B))
> Error: 14612182336 : value doesn't match constraint :S32CONST in template for CCL::ADD-CONSTANT .
> While executing: CCL::MATCH-VREG, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

Change History

comment:1 Changed 5 years ago by rme

  • Owner changed from gb to rme
  • Status changed from new to assigned

comment:2 Changed 5 years ago by rme

Slightly simpler test case:

(defun bug1 (x)
  (declare (optimize (safety 2)))
  (+ (load-time-value 1) 1826522792 x))
> Error: 14612182336 : value doesn't match constraint :S32CONST in template for ADD-CONSTANT .
> While executing: MATCH-VREG, in process listener(1).

Similarly broken:

? (defun bug2 (p) (%inc-ptr p (expt 2 31)))
> Error: 2147483648 : value doesn't match constraint :S32CONST in template for ADD-CONSTANT .
> While executing: MATCH-VREG, in process listener(1).

comment:3 Changed 5 years ago by rme

(In [13072]) In X862-INLINE-ADD2: fixnums won't always fit into a (signed-byte 32).

X862-%IMMEDIATE-INC-PTR: ditto; also correct indentation.

(On x8664, there's no add instruction that accepts a 64-bit immediate operand.)

(See ticket:612)

comment:4 Changed 5 years ago by rme

  • Status changed from assigned to closed
  • Resolution set to fixed

Should be fixed both in the trunk and in the 1.4 branch.

comment:5 Changed 4 years ago by rme

  • Status changed from closed to reopened
  • Resolution fixed deleted

On ppc32, the test ccl.bug#612-3 (which is essentially BUG2 above) fails.

comment:6 Changed 4 years ago by gb

  • Status changed from reopened to closed
  • Resolution set to fixed

Failing on 32-bit ports is correct; %INC-PTR's second argument is documented to be a FIXNUM, and it's perfectly reasonably for a 32-bit implementation to complain about (EXPT 2 31).

I commented out the test, until we can figure out how to test for what we're really trying to test for.

Note: See TracTickets for help on using tickets.