diff mbox

[1/2] Revert PR49721's patch

Message ID 1407556266-12337-2-git-send-email-apinski@cavium.com
State New
Headers show

Commit Message

Andrew Pinski Aug. 9, 2014, 3:51 a.m. UTC
OK? When the second patch is approved?

Thanks,
Andrew Pinski

ChangeLog:
	Revert:
	2011-08-19  H.J. Lu  <hongjiu.lu@intel.com>

        PR middle-end/49721
        * explow.c (convert_memory_address_addr_space): Also permute the
        conversion and addition of constant for zero-extend.

---
 gcc/explow.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

Comments

Andrew Pinski Oct. 13, 2014, 10:35 p.m. UTC | #1
On Fri, Aug 8, 2014 at 8:51 PM, Andrew Pinski <apinski@cavium.com> wrote:
> OK? When the second patch is approved?

Ping?

>
> Thanks,
> Andrew Pinski
>
> ChangeLog:
>         Revert:
>         2011-08-19  H.J. Lu  <hongjiu.lu@intel.com>
>
>         PR middle-end/49721
>         * explow.c (convert_memory_address_addr_space): Also permute the
>         conversion and addition of constant for zero-extend.
>
> ---
>  gcc/explow.c |   19 +++++++------------
>  1 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/gcc/explow.c b/gcc/explow.c
> index 92c4e57..eb7dc85 100644
> --- a/gcc/explow.c
> +++ b/gcc/explow.c
> @@ -376,23 +376,18 @@ convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED,
>
>      case PLUS:
>      case MULT:
> -      /* FIXME: For addition, we used to permute the conversion and
> -        addition operation only if one operand is a constant and
> -        converting the constant does not change it or if one operand
> -        is a constant and we are using a ptr_extend instruction
> -        (POINTERS_EXTEND_UNSIGNED < 0) even if the resulting address
> -        may overflow/underflow.  We relax the condition to include
> -        zero-extend (POINTERS_EXTEND_UNSIGNED > 0) since the other
> -        parts of the compiler depend on it.  See PR 49721.
> -
> +      /* For addition we can safely permute the conversion and addition
> +        operation if one operand is a constant and converting the constant
> +        does not change it or if one operand is a constant and we are
> +        using a ptr_extend instruction  (POINTERS_EXTEND_UNSIGNED < 0).
>          We can always safely permute them if we are making the address
>          narrower.  */
>        if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
>           || (GET_CODE (x) == PLUS
>               && CONST_INT_P (XEXP (x, 1))
> -             && (POINTERS_EXTEND_UNSIGNED != 0
> -                 || XEXP (x, 1) == convert_memory_address_addr_space
> -                                       (to_mode, XEXP (x, 1), as))))
> +             && (XEXP (x, 1) == convert_memory_address_addr_space
> +                                  (to_mode, XEXP (x, 1), as)
> +                 || POINTERS_EXTEND_UNSIGNED < 0)))
>         return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
>                                convert_memory_address_addr_space
>                                  (to_mode, XEXP (x, 0), as),
> --
> 1.7.2.5
>
Richard Biener Oct. 14, 2014, 9:14 a.m. UTC | #2
On Tue, Oct 14, 2014 at 12:35 AM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Fri, Aug 8, 2014 at 8:51 PM, Andrew Pinski <apinski@cavium.com> wrote:
>> OK? When the second patch is approved?
>
> Ping?

Ok if the second patch was approved.

Richard.

>>
>> Thanks,
>> Andrew Pinski
>>
>> ChangeLog:
>>         Revert:
>>         2011-08-19  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>         PR middle-end/49721
>>         * explow.c (convert_memory_address_addr_space): Also permute the
>>         conversion and addition of constant for zero-extend.
>>
>> ---
>>  gcc/explow.c |   19 +++++++------------
>>  1 files changed, 7 insertions(+), 12 deletions(-)
>>
>> diff --git a/gcc/explow.c b/gcc/explow.c
>> index 92c4e57..eb7dc85 100644
>> --- a/gcc/explow.c
>> +++ b/gcc/explow.c
>> @@ -376,23 +376,18 @@ convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED,
>>
>>      case PLUS:
>>      case MULT:
>> -      /* FIXME: For addition, we used to permute the conversion and
>> -        addition operation only if one operand is a constant and
>> -        converting the constant does not change it or if one operand
>> -        is a constant and we are using a ptr_extend instruction
>> -        (POINTERS_EXTEND_UNSIGNED < 0) even if the resulting address
>> -        may overflow/underflow.  We relax the condition to include
>> -        zero-extend (POINTERS_EXTEND_UNSIGNED > 0) since the other
>> -        parts of the compiler depend on it.  See PR 49721.
>> -
>> +      /* For addition we can safely permute the conversion and addition
>> +        operation if one operand is a constant and converting the constant
>> +        does not change it or if one operand is a constant and we are
>> +        using a ptr_extend instruction  (POINTERS_EXTEND_UNSIGNED < 0).
>>          We can always safely permute them if we are making the address
>>          narrower.  */
>>        if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
>>           || (GET_CODE (x) == PLUS
>>               && CONST_INT_P (XEXP (x, 1))
>> -             && (POINTERS_EXTEND_UNSIGNED != 0
>> -                 || XEXP (x, 1) == convert_memory_address_addr_space
>> -                                       (to_mode, XEXP (x, 1), as))))
>> +             && (XEXP (x, 1) == convert_memory_address_addr_space
>> +                                  (to_mode, XEXP (x, 1), as)
>> +                 || POINTERS_EXTEND_UNSIGNED < 0)))
>>         return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
>>                                convert_memory_address_addr_space
>>                                  (to_mode, XEXP (x, 0), as),
>> --
>> 1.7.2.5
>>
Jeff Law Oct. 15, 2014, 5:29 p.m. UTC | #3
On 10/13/14 16:35, Andrew Pinski wrote:
> On Fri, Aug 8, 2014 at 8:51 PM, Andrew Pinski <apinski@cavium.com> wrote:
>> OK? When the second patch is approved?
>
> Ping?
>
>>
>> Thanks,
>> Andrew Pinski
>>
>> ChangeLog:
>>          Revert:
>>          2011-08-19  H.J. Lu  <hongjiu.lu@intel.com>
>>
>>          PR middle-end/49721
>>          * explow.c (convert_memory_address_addr_space): Also permute the
>>          conversion and addition of constant for zero-extend.
OK if/when 2nd patch is approved.  As far as I can tell, it hasn't been 
approved yet.

jeff
Andrew Pinski Oct. 15, 2014, 5:31 p.m. UTC | #4
On Wed, Oct 15, 2014 at 10:29 AM, Jeff Law <law@redhat.com> wrote:
> On 10/13/14 16:35, Andrew Pinski wrote:
>>
>> On Fri, Aug 8, 2014 at 8:51 PM, Andrew Pinski <apinski@cavium.com> wrote:
>>>
>>> OK? When the second patch is approved?
>>
>>
>> Ping?
>>
>>>
>>> Thanks,
>>> Andrew Pinski
>>>
>>> ChangeLog:
>>>          Revert:
>>>          2011-08-19  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>          PR middle-end/49721
>>>          * explow.c (convert_memory_address_addr_space): Also permute the
>>>          conversion and addition of constant for zero-extend.
>
> OK if/when 2nd patch is approved.  As far as I can tell, it hasn't been
> approved yet.

Both patches were approved yesterday.  Richard Biener approved this
one and Richard Henderson approved the second patch with a minor
change.

Thanks,
Andrew

>
> jeff
>
Jeff Law Oct. 15, 2014, 5:32 p.m. UTC | #5
On 10/13/14 16:35, Andrew Pinski wrote:
> On Fri, Aug 8, 2014 at 8:51 PM, Andrew Pinski <apinski@cavium.com> wrote:
>> OK? When the second patch is approved?
>
> Ping?
Nevermind my comments, both were approved in the last day or two.

jeff
diff mbox

Patch

diff --git a/gcc/explow.c b/gcc/explow.c
index 92c4e57..eb7dc85 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -376,23 +376,18 @@  convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED,
 
     case PLUS:
     case MULT:
-      /* FIXME: For addition, we used to permute the conversion and
-	 addition operation only if one operand is a constant and
-	 converting the constant does not change it or if one operand
-	 is a constant and we are using a ptr_extend instruction
-	 (POINTERS_EXTEND_UNSIGNED < 0) even if the resulting address
-	 may overflow/underflow.  We relax the condition to include
-	 zero-extend (POINTERS_EXTEND_UNSIGNED > 0) since the other
-	 parts of the compiler depend on it.  See PR 49721.
-
+      /* For addition we can safely permute the conversion and addition
+	 operation if one operand is a constant and converting the constant
+	 does not change it or if one operand is a constant and we are
+	 using a ptr_extend instruction  (POINTERS_EXTEND_UNSIGNED < 0).
 	 We can always safely permute them if we are making the address
 	 narrower.  */
       if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
 	  || (GET_CODE (x) == PLUS
 	      && CONST_INT_P (XEXP (x, 1))
-	      && (POINTERS_EXTEND_UNSIGNED != 0
-		  || XEXP (x, 1) == convert_memory_address_addr_space
-		  			(to_mode, XEXP (x, 1), as))))
+	      && (XEXP (x, 1) == convert_memory_address_addr_space
+				   (to_mode, XEXP (x, 1), as)
+                 || POINTERS_EXTEND_UNSIGNED < 0)))
 	return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
 			       convert_memory_address_addr_space
 				 (to_mode, XEXP (x, 0), as),