public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: LIU Hao <lh_mouse@126.com>
To: Xi Ruoyao <xry111@xry111.site>,
	GCC Patches <gcc-patches@gcc.gnu.org>, JonY <10walls@gmail.com>
Subject: Re: [PATCH] Remove size limit of PCH
Date: Tue, 10 May 2022 21:30:03 +0800	[thread overview]
Message-ID: <2eaf9cb8-c215-4595-1dca-4261f88fe4e3@126.com> (raw)
In-Reply-To: <832727a2e1f6dbe0564dc57843b4702073563e64.camel@xry111.site>


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

在 2022-05-10 20:00, Xi Ruoyao 写道:
> On Tue, 2022-05-10 at 19:35 +0800, LIU Hao via Gcc-patches wrote:
> 
>> Subject: [PATCH] Remove size limit of PCH
> 
> Make it "Remove size limit of PCH [PR14940]", so once it's committed a
> message will show up in bugzilla.
> 

Here is the revised patch.





-- 
Best regards,
LIU Hao

[-- Attachment #1.1.2: 0001-PR14940-Remove-size-limit-of-PCH.patch --]
[-- Type: text/plain, Size: 2106 bytes --]

From 2e314baed84fd80b3b3c4c67787a032b86dd54dc 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] [PR14940] Remove size limit of PCH

There shouldn't be such a limit in practice.

2022-05-03  LIU Hao <lh_mouse@126.com>

	PR pch/14940
	* config/i386/host-mingw32.cc (pch_VA_max_size): Remove.
	(mingw32_gt_pch_get_address): Remove size limit.
---
 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 3b0d83ffc606..f915b85abd06 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.36.1


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

  reply	other threads:[~2022-05-10 13:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 11:35 LIU Hao
2022-05-10 12:00 ` Xi Ruoyao
2022-05-10 13:30   ` LIU Hao [this message]
2022-05-10 14:28     ` Jakub Jelinek
2022-05-11 14:31       ` LIU Hao
2022-05-11 11:44     ` Jonathan Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2eaf9cb8-c215-4595-1dca-4261f88fe4e3@126.com \
    --to=lh_mouse@126.com \
    --cc=10walls@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).