This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix crash on 64-bit mingw-w64 hosted compiler using more than 4 gb of ram
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Stanislaw Halik <sthalik at misaki dot pl>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Aug 2016 17:00:05 +0200
- Subject: Re: fix crash on 64-bit mingw-w64 hosted compiler using more than 4 gb of ram
- Authentication-results: sourceware.org; auth=none
- References: <5f43d7e4-b3c8-eb58-d39d-743a03d8ec3c@misaki.pl>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 11, 2016 at 11:31:49AM +0200, Stanislaw Halik wrote:
> 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
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66488>
>
> 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
I think you should follow the indentation style of the rest of the file.
So #define rather than #\tdefine. Generally, tab between # and define isn't
used anywhere in GCC, sometimes one space is used to indent per level.
> +#endif
> \ No newline at end of file
Please try to avoid this, terminate the last line with a newline.
Jakub