mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
Don't simplify 'equal?' to 'eq?' when constant is an *inexact* small integer.
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Refine test for fixnums to verify that the small integer is exact. * test-suite/tests/tree-il.test ("primitives"): Add test.
This commit is contained in:
parent
2446f8e126
commit
ebd363161e
2 changed files with 5 additions and 0 deletions
|
@ -509,6 +509,7 @@
|
||||||
(eq? #nil v)
|
(eq? #nil v)
|
||||||
(symbol? v)
|
(symbol? v)
|
||||||
(and (integer? v)
|
(and (integer? v)
|
||||||
|
(exact? v)
|
||||||
(<= v most-positive-fixnum)
|
(<= v most-positive-fixnum)
|
||||||
(>= v most-negative-fixnum)))
|
(>= v most-negative-fixnum)))
|
||||||
(make-application src (make-primitive-ref #f 'eq?)
|
(make-application src (make-primitive-ref #f 'eq?)
|
||||||
|
|
|
@ -106,6 +106,10 @@
|
||||||
(apply (primitive equal?) (const 42) (toplevel x))
|
(apply (primitive equal?) (const 42) (toplevel x))
|
||||||
(apply (primitive eq?) (const 42) (toplevel x)))
|
(apply (primitive eq?) (const 42) (toplevel x)))
|
||||||
|
|
||||||
|
(pass-if-primitives-resolved
|
||||||
|
(apply (primitive equal?) (const 42.0) (toplevel x))
|
||||||
|
(apply (primitive equal?) (const 42.0) (toplevel x)))
|
||||||
|
|
||||||
(pass-if-primitives-resolved
|
(pass-if-primitives-resolved
|
||||||
(apply (primitive equal?) (const #nil) (toplevel x))
|
(apply (primitive equal?) (const #nil) (toplevel x))
|
||||||
(apply (primitive eq?) (const #nil) (toplevel x))))
|
(apply (primitive eq?) (const #nil) (toplevel x))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue