diff mbox

PATCH: Define TRY_EMPTY_VM_SPACE for Linux/x32

Message ID CAMe9rOqU0pCXBSqTgNOTURADBGQ=7aFdX54t3yWnnM=fv58_Dw@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu April 5, 2012, 3:57 p.m. UTC
On Thu, Apr 5, 2012 at 8:36 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Apr 5, 2012 at 3:28 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>>>>> Looking at how other targets implement this check, I don't think that
>>>>> this is a problem at all. This issue only shows on a non-bootstrapped
>>>>> build. A full bootstrap will use correct address.
>>>>
>>>> The other place where it shows up is cross compilers but who is going
>>>> to use a 3.2 compiler with GCC 4.8 anyways?
>>>>
>>>
>>> FWIW, I have no problem with checking __LP64__ only. I just want to
>>> mention this potential issue.
>>>
>>
>> Here is a different patch.  It checks sizeof (void *) for those hosts
>> where it is appropriate.  Does it look OK?
>
> Looks OK to me, but you need a GWP reviewer to OK this change now...
>

Here is the patch with ChangeLog.  Tested on Linux/x32.  Jakub,
is this OK for trunk?

Thanks.

Comments

H.J. Lu April 10, 2012, 2:41 p.m. UTC | #1
On Thu, Apr 5, 2012 at 8:57 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Apr 5, 2012 at 8:36 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> On Thu, Apr 5, 2012 at 3:28 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>>>>>> Looking at how other targets implement this check, I don't think that
>>>>>> this is a problem at all. This issue only shows on a non-bootstrapped
>>>>>> build. A full bootstrap will use correct address.
>>>>>
>>>>> The other place where it shows up is cross compilers but who is going
>>>>> to use a 3.2 compiler with GCC 4.8 anyways?
>>>>>
>>>>
>>>> FWIW, I have no problem with checking __LP64__ only. I just want to
>>>> mention this potential issue.
>>>>
>>>
>>> Here is a different patch.  It checks sizeof (void *) for those hosts
>>> where it is appropriate.  Does it look OK?
>>
>> Looks OK to me, but you need a GWP reviewer to OK this change now...
>>
>
> Here is the patch with ChangeLog.  Tested on Linux/x32.  Jakub,
> is this OK for trunk?
>

Hi Richard,

Is this patch:

http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00303.html

OK for trunk?

Thanks.
H.J. Lu April 11, 2012, 7:40 p.m. UTC | #2
On Tue, Apr 10, 2012 at 7:41 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Apr 5, 2012 at 8:57 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Apr 5, 2012 at 8:36 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>> On Thu, Apr 5, 2012 at 3:28 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>>>>>> Looking at how other targets implement this check, I don't think that
>>>>>>> this is a problem at all. This issue only shows on a non-bootstrapped
>>>>>>> build. A full bootstrap will use correct address.
>>>>>>
>>>>>> The other place where it shows up is cross compilers but who is going
>>>>>> to use a 3.2 compiler with GCC 4.8 anyways?
>>>>>>
>>>>>
>>>>> FWIW, I have no problem with checking __LP64__ only. I just want to
>>>>> mention this potential issue.
>>>>>
>>>>
>>>> Here is a different patch.  It checks sizeof (void *) for those hosts
>>>> where it is appropriate.  Does it look OK?
>>>
>>> Looks OK to me, but you need a GWP reviewer to OK this change now...
>>>
>>
>> Here is the patch with ChangeLog.  Tested on Linux/x32.  Jakub,
>> is this OK for trunk?
>>
>
> Hi Richard,
>
> Is this patch:
>
> http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00303.html
>
> OK for trunk?
>

I checked in this patch to check __x86_64 and __LP64__.
I will submit a followup patch to simplify it later.

Thanks.
diff mbox

Patch

2012-04-03  H.J. Lu  <hongjiu.lu@intel.com>

	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Check pointer size
	for alpha, arm, i386 and x86-64.

diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c
index 94b7a0b..93c513e 100644
--- a/gcc/config/host-linux.c
+++ b/gcc/config/host-linux.c
@@ -64,14 +64,12 @@ 
 
 /* For various ports, try to guess a fixed spot in the vm space
    that's probably free.  */
-#if defined(__alpha)
-# define TRY_EMPTY_VM_SPACE	0x10000000000
+#if defined(__alpha) || defined(__ARM_EABI__) || defined(__i386) \
+    || defined(__x86_64)
+# define TRY_EMPTY_VM_SPACE	\
+  (sizeof (void *) == 8 ? 0x1000000000 : 0x60000000)
 #elif defined(__ia64)
 # define TRY_EMPTY_VM_SPACE	0x2000000100000000
-#elif defined(__x86_64)
-# define TRY_EMPTY_VM_SPACE	0x1000000000
-#elif defined(__i386)
-# define TRY_EMPTY_VM_SPACE	0x60000000
 #elif defined(__powerpc__)
 # define TRY_EMPTY_VM_SPACE	0x60000000
 #elif defined(__s390x__)
@@ -84,8 +82,6 @@ 
 # define TRY_EMPTY_VM_SPACE	0x60000000
 #elif defined(__mc68000__)
 # define TRY_EMPTY_VM_SPACE	0x40000000
-#elif defined(__ARM_EABI__)
-# define TRY_EMPTY_VM_SPACE     0x60000000
 #elif defined(__mips__) && defined(__LP64__)
 # define TRY_EMPTY_VM_SPACE	0x8000000000
 #elif defined(__mips__)