]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Change the value of macro TRY_EMPTY_VM_SPACE from 0x8000000000 to 0x100000...
authorLulu Cheng <chenglulu@loongson.cn>
Mon, 20 Feb 2023 08:47:11 +0000 (16:47 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 27 Feb 2023 01:05:11 +0000 (09:05 +0800)
The PCH mechanism first tries to map the .gch file to the virtual memory
space pointed to by TRY_EMPTY_VM_SPACE during the compilation process.

The original value of TRY_EMPTY_VM_SPACE macro is 0x8000000000,
but like la464 only has 40 bits of virtual address space, this value
just exceeds the address range.

If we want to support chips with less than 40 bits virtual addresses,
then the value of this macro needs to be set small. I think setting
this value small will increase the probability of virtual address
mapping failure. And the purpose of pch is to make compilation faster,
but I think we rarely compile on embedded systems. So this situation
may not be within our consideration.

So change the value of this macro to 0x1000000000.

gcc/ChangeLog:

* config/host-linux.cc (TRY_EMPTY_VM_SPACE): Modify the value of
the macro to 0x1000000000.

gcc/config/host-linux.cc

index a891651a7b62254d0497a8b99ac6dc46910767b4..d1aa7ab28ca016b1b7df81d0ca8e84b6c4fc12c0 100644 (file)
@@ -99,7 +99,7 @@
 #elif defined(__riscv) && defined (__LP64__)
 # define TRY_EMPTY_VM_SPACE    0x1000000000
 #elif defined(__loongarch__) && defined(__LP64__)
-# define TRY_EMPTY_VM_SPACE    0x8000000000
+# define TRY_EMPTY_VM_SPACE    0x1000000000
 #else
 # define TRY_EMPTY_VM_SPACE    0
 #endif