Regression in float truncate and friends

Bug #489388 reported by Christophe Rhodes on 2009-11-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Report from Christophe Rhodes on sbcl-devel

 affects sbcl
 status confirmed
 importance medium
 tag compiler floating-point types


Prior to, the following

  (compile nil '(lambda (x)
                  (declare (type (single-float 0.0 1.0) x)
                                 (optimize speed (safety 0)))
                  (values (truncate (* x 1000.0)))))

compiles without notes to straight-line FPU code. In current HEAD, the
same compiles to a full call to %UNARY-TRUNCATE/SINGLE-FLOAT. If I had
to guess, based on the compiler notes generated, I'd guess that the type
derivation information from TRUNCATE gets lost along the way.

Since I think this isn't actually a regression from the previous
release, I'm not going to hold the release for it, but I will accept a
tested and reviewed patch if someone produces one.



This appears to be yet another case of IR1 transform stomping on VOPs. Disabling the TRUNCATE transform gives the desired code. *sigh*

Was it Paul who had the sketch for inhibiting transforms when we have applicable VOPs? What was the status of that? Should I back out the floating point truncate changes, which were a win only for case we could not implement using the straight-line version, or...?



 -- Nikodemus

Paul Khuong (pvk) on 2010-01-27
Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers