public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts
@ 2023-02-16 16:09 LIU Hao
  2023-03-01  8:51 ` NightStrike
  0 siblings, 1 reply; 4+ messages in thread
From: LIU Hao @ 2023-02-16 16:09 UTC (permalink / raw)
  To: Jonathan Yong, gcc-patches


[-- Attachment #1.1.1: Type: text/plain, Size: 31 bytes --]


-- 
Best regards,
LIU Hao

[-- Attachment #1.1.2: 0001-gcc-Remove-size-limit-of-PCH-for-mingw32-hosts.patch --]
[-- Type: text/plain, Size: 2399 bytes --]

From a4d5e161fbaa5b9994077ffb474e2b55c6c3b3cb Mon Sep 17 00:00:00 2001
From: LIU Hao <lh_mouse@126.com>
Date: Tue, 10 May 2022 13:19:07 +0800
Subject: [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts

PCHs can now be relocated, so the size limit makes no sense any more.

This patch was submited to MSYS2 9 months ago for GCC 12. No issue has been reported so far.

Reference: https://github.com/msys2/MINGW-packages/blob/717d5a5a09e2370e3bd7e12b393a26dbfbe48921/mingw-w64-gcc/0010-Fix-using-large-PCH.patch
Signed-off-by: LIU Hao <lh_mouse@126.com>

gcc/ChangeLog:

	PR pch/14940
	* gcc/config/i386/host-mingw32.cc (mingw32_gt_pch_get_address):
	Remove the size limit `pch_VA_max_size`
---
 gcc/config/i386/host-mingw32.cc | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index aeee956ed11..acff6138d63 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -44,9 +44,6 @@ static size_t mingw32_gt_pch_alloc_granularity (void);
 
 static inline void w32_error(const char*, const char*, int, const char*);
 
-/* FIXME: Is this big enough?  */
-static const size_t pch_VA_max_size  = 128 * 1024 * 1024;
-
 /* Granularity for reserving address space.  */
 static size_t va_granularity = 0x10000;
 
@@ -88,9 +85,6 @@ static void *
 mingw32_gt_pch_get_address (size_t size, int)
 {
   void* res;
-  size = (size + va_granularity - 1) & ~(va_granularity - 1);
-  if (size > pch_VA_max_size)
-    return NULL;
 
   /* FIXME: We let system determine base by setting first arg to NULL.
      Allocating at top of available address space avoids unnecessary
@@ -100,7 +94,7 @@ mingw32_gt_pch_get_address (size_t size, int)
      If we allocate at bottom we need to reserve the address as early
      as possible and at the same point in each invocation. */
  
-  res = VirtualAlloc (NULL, pch_VA_max_size,
+  res = VirtualAlloc (NULL, size,
 		      MEM_RESERVE | MEM_TOP_DOWN,
 		      PAGE_NOACCESS);
   if (!res)
@@ -150,7 +144,7 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
 
   /* Offset must be also be a multiple of allocation granularity for
      this to work.  We can't change the offset. */ 
-  if ((offset & (va_granularity - 1)) != 0 || size > pch_VA_max_size)
+  if ((offset & (va_granularity - 1)) != 0)
     return -1;
 
 
-- 
2.39.2


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts
  2023-02-16 16:09 [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts LIU Hao
@ 2023-03-01  8:51 ` NightStrike
  2023-03-01  9:21   ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: NightStrike @ 2023-03-01  8:51 UTC (permalink / raw)
  To: LIU Hao; +Cc: Jonathan Yong, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

On Thu, Feb 16, 2023, 11:10 LIU Hao via Gcc-patches <gcc-patches@gcc.gnu.org>
wrote:

>
> --
> Best regards,
> LIU Hao
>

Ping

>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts
  2023-03-01  8:51 ` NightStrike
@ 2023-03-01  9:21   ` Richard Biener
  2023-03-01 13:47     ` Jonathan Yong
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2023-03-01  9:21 UTC (permalink / raw)
  To: NightStrike; +Cc: LIU Hao, Jonathan Yong, GCC Patches

On Wed, Mar 1, 2023 at 9:52 AM NightStrike via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, Feb 16, 2023, 11:10 LIU Hao via Gcc-patches <gcc-patches@gcc.gnu.org>
> wrote:
>
> >
> > --
> > Best regards,
> > LIU Hao
> >
>
> Ping

OK.

> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts
  2023-03-01  9:21   ` Richard Biener
@ 2023-03-01 13:47     ` Jonathan Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2023-03-01 13:47 UTC (permalink / raw)
  To: Richard Biener, NightStrike; +Cc: LIU Hao, GCC Patches

On 3/1/23 09:21, Richard Biener wrote:
> On Wed, Mar 1, 2023 at 9:52 AM NightStrike via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> On Thu, Feb 16, 2023, 11:10 LIU Hao via Gcc-patches <gcc-patches@gcc.gnu.org>
>> wrote:
>>
>>>
>>> --
>>> Best regards,
>>> LIU Hao
>>>
>>
>> Ping
> 
> OK.
> 
>>>

Done, pushed to master branch.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-01 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 16:09 [PATCH] gcc: Remove size limit of PCH for *-*-mingw32 hosts LIU Hao
2023-03-01  8:51 ` NightStrike
2023-03-01  9:21   ` Richard Biener
2023-03-01 13:47     ` Jonathan Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).