Regression in float truncate and friends

Bug #489388 reported by Christophe Rhodes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Unassigned

Bug Description

Report from Christophe Rhodes on sbcl-devel

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

Hi,

Prior to 1.0.30.38, 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.

Cheers,

Christophe

Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: [Bug 489388] [NEW] Regression in float truncate and friends

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...?

(Context: https://bugs.launchpad.net/bugs/489388)

Cheers,

 -- Nikodemus

Paul Khuong (pvk)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.