This is the mail archive of the gcc-bugs@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: Another bootstrap failure on vax: TImodes


Hi,
this should fix the problem with signaling shift overflow on creating TImode type
structure.

I simply handle it by cutting the precision for purpose of min/max value calculation.
This should work well.

Can you please check, that the crash goes away?

Honza

Tue Oct 16 16:07:00 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* stor-layout.c (fixup_signed_type, fixup_unsigned_type): Avoid
	overflow for types greater then 2 * HOST_WIDE_INT.

Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stor-layout.c,v
retrieving revision 1.108
diff -c -3 -p -r1.108 stor-layout.c
*** stor-layout.c	2001/10/11 03:16:10	1.108
--- stor-layout.c	2001/10/16 14:06:43
*************** fixup_signed_type (type)
*** 1743,1748 ****
--- 1743,1754 ----
  {
    int precision = TYPE_PRECISION (type);
  
+   /* We can not represent properly constants greater then
+      2 * HOST_BITS_PER_WIDE_INT, still we need the types
+      as they are used by i386 vector extensions and friends.  */
+   if (precision > HOST_BITS_PER_WIDE_INT * 2)
+     precision = HOST_BITS_PER_WIDE_INT * 2;
+ 
    TYPE_MIN_VALUE (type)
      = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
  		    ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
*************** fixup_unsigned_type (type)
*** 1774,1779 ****
--- 1780,1791 ----
       tree type;
  {
    int precision = TYPE_PRECISION (type);
+ 
+   /* We can not represent properly constants greater then
+      2 * HOST_BITS_PER_WIDE_INT, still we need the types
+      as they are used by i386 vector extensions and friends.  */
+   if (precision > HOST_BITS_PER_WIDE_INT * 2)
+     precision = HOST_BITS_PER_WIDE_INT * 2;
  
    TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
    TYPE_MAX_VALUE (type)


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