This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Another bootstrap failure on vax: TImodes
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: Another bootstrap failure on vax: TImodes
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 16 Oct 2001 16:11:25 +0200
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- References: <20010929153216.A4648@atrey.karlin.mff.cuni.cz> <200109291424.f8TEOH4C005135@hiauly1.hia.nrc.ca>
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)