PPC64 Compiler bug !!

linas at austin.ibm.com linas at austin.ibm.com
Sat Jun 14 03:23:44 EST 2003

On Fri, Jun 13, 2003 at 12:40:06PM -0400, David Edelsohn wrote:
> >>>>> linas  writes:
> linas> What do you mean by 'safely'? Surely -msoft-float is "safe" or is that
> linas> not true?
> 	-msoft-float converts all floating point computations to
> emulation, as opposed to only using FPRs for floating point statements.
> Please review the original problem and the documentation for
> "-msoft-float" for more information.

Based on the email replies, and on a few tests run over here,
-msoft-float also seems to have the undocumented but valuable side
effect of preventing the use of FPR's in DImode moves.  The Linux
kernel appears to depend vitally on this side-effect.

My documentation seems to only mention -msoft-float for the DEC Alpha,
and not as a PPC flag.

The original problem was that a third party wrote a Linux device
driver that failed to use the msoft-float flag, and then handed
that code off to some kernel developers here, who didn't know
about this flag.  They complained of intermittent crashes, which
become very common with the latest compiler.  It got escalated,
it landed on my desk.  I was surprised to see floating pt instructions
being generated in integer code, as this will cause obvious
race conditions and corruption in the kernel.

> linas> During one of the intermediate stages of processing, one must surely
> linas> be able to scan the function and realize that it was integer-only.
> linas> At this point, if -O3 is not set, one could internally turn on -msoft-float,
> linas> and continue onwards.  Surely, this would be a safe and simple way to
> linas> gaurentee the desired result.
> 	Such a patch would not be limited to the target-specific portion
> of the compiler, which is what all of the previous patches have limited
> themselves to.

I can't comment on the quality of the previous patches; its reasonable
to think a target-specific patch would be preferable.

On the other hand, if DImode moves are a good optimization for PPC, its
likely that it would be good for other modern CPU's as well.

There also seem to be other problems mixed into the controversy as well,
this seems to be clouding the issue.


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc64-dev mailing list