summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/hwint.h23
2 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a1418e8b348..794cb1f6af0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-03 Alexandre Oliva <aoliva@redhat.com>
+
+ Re-installed 2001-01-09's patch:
+ * hwint.h (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Use long long
+ if it's wider than long and the target's long is wider than the
+ host's.
+
2001-05-02 David O'Brien <obrien@FreeBSD.org>
* config.gcc, config/rs6000/aix51.h, config/rs6000/mach.h: Do not
diff --git a/gcc/hwint.h b/gcc/hwint.h
index e4ec51cba7a..9551dc5ccd9 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -27,6 +27,29 @@
/* Find the largest host integer type and set its size and type. */
+/* Use long long on the host if the target has a wider long type than
+ the host. */
+
+#if ! defined HOST_BITS_PER_WIDE_INT \
+ && defined HOST_BITS_PER_LONGLONG \
+ && (HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG) \
+ && (defined (LONG_LONG_MAX) || defined (LONGLONG_MAX) \
+ || defined (LLONG_MAX) || defined (__GNUC__))
+
+# ifdef MAX_LONG_TYPE_SIZE
+# if MAX_LONG_TYPE_SIZE > HOST_BITS_PER_LONG
+# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG
+# define HOST_WIDE_INT long long
+# endif
+# else
+# if LONG_TYPE_SIZE > HOST_BITS_PER_LONG
+# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG
+# define HOST_WIDE_INT long long
+# endif
+# endif
+
+#endif
+
#ifndef HOST_BITS_PER_WIDE_INT
# if HOST_BITS_PER_LONG > HOST_BITS_PER_INT