Opened 13 years ago

Last modified 13 years ago

#375 assigned defect

ccl::%svref with "large" fixnum indices

Reported by: gb Owned by: gb
Priority: minor Milestone:
Component: Compiler Version: trunk
Keywords: Cc: rme


I'm not sure if this is limited to just %svref (it might happen for other vector types in unsafe code, but:

? (defun foo (v)
  (%svref v 40000))
> Error: bad regspec: NIL
> While executing: %HARD-REGSPEC-VALUE, in process listener(1).

Some of the x8664 constants may also be a bit off, but x8632::max-32-bit-constant-index is supposed to be an upper bound on the largest integer we can use to access an element in a 32-bit vector, i.e., a little bit less than MOST-POSITIVE-FIXNUM when misc-data-offset/misc-float-offset are accounted for. This number was much smaller on PPC, where constent displacements have to fit in 16 bits.

Change History (1)

comment:1 Changed 13 years ago by gb

  • Priority changed from normal to minor
  • Status changed from new to assigned

The x8664 is also a bit confused here:

? (defun foo (v)
  (%svref v (ash 1 40)))
> Error: bad regspec: NIL

x862-vref is convinced that the index doesn't need a register if it's constant and we aren't bounds-checking. x862-vref1 expects its caller to have allocated a register for the index if it's a constant that's too large to be used as a memory address displacement.

I haven't checked the PPC. (Presumably, very large constant vector indices are rarely used ...)

Note: See TracTickets for help on using tickets.