fix crash on 64-bit mingw-w64 hosted compiler using more than 4 gb of ram

2016-08-11 Thread Stanislaw Halik

The host configuration across platforms wrongly assumes that
sizeof(long) == sizeof(intptr_t) which is incorrect on amd64-hosted 
compiler hosting mingw-w64.


Here's a patch fixing


cheers,
sh
diff --git a/gcc/config/i386/xm-mingw32.h b/gcc/config/i386/xm-mingw32.h
index 501cebd..1b17263 100644
--- a/gcc/config/i386/xm-mingw32.h
+++ b/gcc/config/i386/xm-mingw32.h
@@ -38,3 +38,7 @@ along with GCC; see the file COPYING3.  If not see
 #define HOST_LONG_LONG_FORMAT "I64"
 #endif
 
+/* this is to prevent ggc-heap.c from assuming sizeof(long) == 
sizeof(intptr_t) */
+#ifdef __x86_64__
+#  define HOST_BITS_PER_PTR 64
+#endif
\ No newline at end of file


Re: fix crash on 64-bit mingw-w64 hosted compiler using more than 4 gb of ram

2016-08-11 Thread Stanislaw Halik

On 2016-08-11 Thu 16:33, Kai Tietz wrote:

Hello Stanislaw.

patch is ok.  Nevertheless there is a ChangeLog entry missing for it.
It is mandatory to be provided for submissions to gcc.


ChangeLog:

PR target/66488
* gcc/config/i386/xm-mingw32.h (HOST_BITS_PER_PTR): specify pointer
size as distinct from sizeof long, for the use in gcc/ggc-page.c