This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tiny tree.c update


> 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]