"H.J. Lu" <hjl.to...@gmail.com> writes:
> On Sun, Aug 14, 2011 at 9:22 AM, H.J. Lu <hjl.to...@gmail.com> wrote:
>> Hi,
>>
>> This patch is needed for x32 and only affects x32.  Any comments/objections
>> to apply this to finish x32 support?
>>
>> Thanks.
>>
>>
>> H.J.
>> ----
>> On Thu, Aug 11, 2011 at 6:25 AM, H.J. Lu <hjl.to...@gmail.com> wrote:
>>> Hi,
>>>
>>> This is the last patch needed for x32 support.
>>> convert_memory_address_addr_space
>>> is called to convert a memory address without overflow/underflow.  It
>>> should be safe
>>> to transform
>>>
>>> (zero_extend:DI (plus:SI (FOO:SI) (const_int Y)))
>>>
>>> to
>>>
>>> (plus:DI (zero_extend:DI (FOO:SI)) (const_int Y))
>>>
>>> GCC only works this way.  Any comments?
>>>
>>> Thanks.
>>>
>>> H.J.
>>> ----
>>> On Sun, Aug 7, 2011 at 1:08 PM, H.J. Lu <hongjiu...@intel.com> wrote:
>>>> Hi,
>>>>
>>>> We transform
>>>>
>>>> ptr_extend:DI (plus:SI (FOO:SI) (const_int Y)))
>>>>
>>>> to
>>>>
>>>> (plus:DI (ptr_extend:DI (FOO:SI)) (const_int Y))
>>>>
>>>> since this is how Pmode != ptr_mode is supported even if the resulting
>>>> address may overflow/underflow.   It is also true for x32 which has
>>>> zero_extend instead of ptr_extend.  I have tried different approaches
>>>> to avoid transforming
>>>>
>>>> (zero_extend:DI (plus:SI (FOO:SI) (const_int Y)))
>>>>
>>>> to
>>>>
>>>> (plus:DI (zero_extend:DI (FOO:SI)) (const_int Y))
>>>>
>>>> without success.  This patch relaxes the condition to check
>>>> POINTERS_EXTEND_UNSIGNED != 0 instead if POINTERS_EXTEND_UNSIGNED < 0
>>>> to cover both ptr_extend and zero_extend. We can investigate a better
>>>> approach for ptr_extend and zero_extend later.  For now, I believe it
>>>> is the saftest way to support ptr_extend and zero_extend.
>>>>
>>>> Any comments?
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> H.J.
>
> I am checking in this patch, which only affects x32
> and nothing else.  This one character change, from
>
> POINTERS_EXTEND_UNSIGNED < 0
>
> to
>
> POINTERS_EXTEND_UNSIGNED != 0
>
> creates a working x32 GCC. This isn't perfect. I have
> tried many different approaches without any success.
> I will revisit it if we run into any problems with x32
> applications.

Sorry, I know it's frustrating when things don't get reviewed,
but I strongly object to a nonobvious patch like this being applied
without approval.

(And for the record, I can't approve it. :-))

Richard

Reply via email to