tiny tree.c update

John David Anglin dave@hiauly1.hia.nrc.ca
Tue Sep 25 06:54:00 GMT 2001


> Can you describe the VAX problem in more detail?

The vax "ext" instructions generate illegal instruction faults 
when the shift treated as unsigned is > 32 or when the position
specifier (again unsigned) is > 31.

The following code in fixup_unsigned_type causes problems when TI
nodes are built on the vax:

  TYPE_MAX_VALUE (type)
      = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
		     ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
		     precision - HOST_BITS_PER_WIDE_INT > 0
		     ? ((unsigned HOST_WIDE_INT) ~0
		        >> (HOST_BITS_PER_WIDE_INT
			    - (precision - HOST_BITS_PER_WIDE_INT)))
		     : 0);

The right shift in the above evaluates to -64 when HOST_BITS_PER_WIDE_INT
is 32:  32 - (128 - 32).  The behaviour of the right shift operator is
undefined when the shift specified is negative and on the vax it
generates an illegal insn trap.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)



More information about the Gcc-patches mailing list