diff mbox

[5/5,ARC] Fix move_double_src_operand predicate.

Message ID 1490010210-9489-6-git-send-email-claziss@synopsys.com
State New
Headers show

Commit Message

Claudiu Zissulescu March 20, 2017, 11:43 a.m. UTC
Durring compilation process, (subreg (mem ...) ...) can occur. Hence,
we need to check if the address of mem is a valid one. This patch is
fixing this check by directly calling the address_operand, instead of
calling move_double_src_operand, as the latter is always checking
against the original mode, thus, returning false when the inner and
outer modes are different.

gcc/
2016-10-07  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/predicates.md (move_double_src_operand): Replace the
	call to move_double_src_operand with a call to address_operand.
---
 gcc/config/arc/predicates.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Burgess March 24, 2017, 6:47 p.m. UTC | #1
* Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> [2017-03-20 12:43:30 +0100]:

> Durring compilation process, (subreg (mem ...) ...) can occur. Hence,
> we need to check if the address of mem is a valid one. This patch is
> fixing this check by directly calling the address_operand, instead of
> calling move_double_src_operand, as the latter is always checking
> against the original mode, thus, returning false when the inner and
> outer modes are different.
> 
> gcc/
> 2016-10-07  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* config/arc/predicates.md (move_double_src_operand): Replace the
> 	call to move_double_src_operand with a call to
> 	address_operand.

Sounds good, thanks,
Andrew


> ---
>  gcc/config/arc/predicates.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md
> index 8dd8d55..9e60cb7 100644
> --- a/gcc/config/arc/predicates.md
> +++ b/gcc/config/arc/predicates.md
> @@ -318,7 +318,7 @@
>        /* (subreg (mem ...) ...) can occur here if the inner part was once a
>  	 pseudo-reg and is now a stack slot.  */
>        if (GET_CODE (SUBREG_REG (op)) == MEM)
> -	return move_double_src_operand (SUBREG_REG (op), mode);
> +	return address_operand (XEXP (SUBREG_REG (op), 0), mode);
>        else
>  	return register_operand (op, mode);
>      case MEM :
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md
index 8dd8d55..9e60cb7 100644
--- a/gcc/config/arc/predicates.md
+++ b/gcc/config/arc/predicates.md
@@ -318,7 +318,7 @@ 
       /* (subreg (mem ...) ...) can occur here if the inner part was once a
 	 pseudo-reg and is now a stack slot.  */
       if (GET_CODE (SUBREG_REG (op)) == MEM)
-	return move_double_src_operand (SUBREG_REG (op), mode);
+	return address_operand (XEXP (SUBREG_REG (op), 0), mode);
       else
 	return register_operand (op, mode);
     case MEM :