diff mbox

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

Message ID 5f43d7e4-b3c8-eb58-d39d-743a03d8ec3c@misaki.pl
State New
Headers show

Commit Message

Stanislaw Halik Aug. 11, 2016, 9:31 a.m. UTC
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

Comments

Kai Tietz Aug. 11, 2016, 2:33 p.m. UTC | #1
Hello Stanislaw.

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

Thanks,
Kai

2016-08-11 11:31 GMT+02:00 Stanislaw Halik <sthalik@misaki.pl>:
> 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
Stanislaw Halik Aug. 11, 2016, 2:55 p.m. UTC | #2
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
Jakub Jelinek Aug. 11, 2016, 3 p.m. UTC | #3
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
Jakub Jelinek Aug. 11, 2016, 3:03 p.m. UTC | #4
On Thu, Aug 11, 2016 at 04:55:34PM +0200, Stanislaw Halik wrote:
> 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

gcc/ directory has its own ChangeLog, the filename is relative against that.
The description should start after ): with capital letter, end with .
And the description is what has changed, not why.
So
	PR target/66488
	* config/i386/xm-mingw32.h (HOST_BITS_PER_PTR): Define if __x86_64__.
or so would be better.

	Jakub
diff mbox

Patch

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