Patch for gcc/config/mips.md

Will Cohen wcohen@redhat.com
Fri Oct 6 07:48:00 GMT 2000


 
I have found that the define_expand "zero_extendsidi2" does not
improve the quality of code generated for the mips. The compiler
generates the same sequence of RTL statements without it.  An
unfortunate side effect of this define expand is that the compiler
generates a note which with is later optimized incorrectly. This
mistake occurs when a negative value is type casted into an unsigned
int.  The resulting value should have the upper 32-bits of the 64-bit
register be zero, but the compiler generates constant that sign
extends, setting the upper 32-bits to 1's.  This patch removes the
define_expand and eliminates the problem note.

This fix is not ideal.  There really should be some information
associated with constants values to indicate the number of valid bits
in constant, so constant propagation works correctly in all cases.
Constants in the compiler are VOIDmode indicating all bits are used.
However, changing this to indicate the width of the constant this
would require changes in many places in the compiler.

        * config/mips/mips.md: Removed define_expand for
        "zero_extendsidi2" because compiler generates the same RTL without
        it and performs incorrect constant propagation with it.

-Will Cohen


More information about the Gcc-patches mailing list