Combine known_cond() may create subreg of const_int

Alexandre Oliva aoliva@redhat.com
Sun Feb 24 15:06:00 GMT 2002


On Feb 20, 2002, Richard Henderson <rth@redhat.com> wrote:

> On Wed, Feb 20, 2002 at 06:25:51PM -0300, Alexandre Oliva wrote:
>> -#define SPARC_SETHI_P(X) \
>> -(((unsigned HOST_WIDE_INT) (X) & \
>> -  (TARGET_ARCH64 ? ~(unsigned HOST_WIDE_INT) 0xfffffc00 : 0x3ff)) == 0)
>> +#define SPARC_SETHI_P(X) (((unsigned HOST_WIDE_INT) (X) & 0x3ff) == 0)

> This change is ok for SImode constants, but not DImode,
> since sethi really sets 0x00000000fffffc00 for sparc64.

> Thus the uses of this predicate must be audited.  It looks
> like at least some of the uses in sparc.c are protected by

>   && INTVAL (X) >= 0

> but the 'K' constraint is not.  We probably can't use the
> same constraint letter for sparc64 at all, since we do 
> still want SImode patterns to use SETHI for negative values.

Agreed.  Here's a patch that implements the change you implied.
Bootstrapped on sparc-sun-solaris2.7 and sparcv9-sun-solaris2.7.
Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparcv9-const.patch
Type: text/x-patch
Size: 6934 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020224/87bee298/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Gcc-patches mailing list