diff mbox

[7/7,ARC] Test against frame_pointer_needed in arc_can_eliminate.

Message ID 1495189862-20533-8-git-send-email-claziss@synopsys.com
State New
Headers show

Commit Message

Claudiu Zissulescu May 19, 2017, 10:31 a.m. UTC
arc_can_eliminate is using arc_frmae_pointer_required() which is wrong
as the frame_pointer_needed can be set on different conditions. Fix it
by calling arc_frame_pointer_needed().

gcc/
2017-01-09  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_can_eliminate): Test against
	arc_frame_pointer_needed.
---
 gcc/config/arc/arc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Burgess May 31, 2017, 4:04 p.m. UTC | #1
* Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> [2017-05-19 12:31:02 +0200]:

> arc_can_eliminate is using arc_frmae_pointer_required() which is wrong
> as the frame_pointer_needed can be set on different conditions. Fix it
> by calling arc_frame_pointer_needed().
> 
> gcc/
> 2017-01-09  Claudiu Zissulescu  <claziss@synopsys.com>
> 
> 	* config/arc/arc.c (arc_can_eliminate): Test against
> 	arc_frame_pointer_needed.

Looks good,

thanks,
Andrew



> ---
>  gcc/config/arc/arc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
> index 0c4c901..aac1952 100644
> --- a/gcc/config/arc/arc.c
> +++ b/gcc/config/arc/arc.c
> @@ -4733,7 +4733,7 @@ arc_final_prescan_insn (rtx_insn *insn, rtx *opvec ATTRIBUTE_UNUSED,
>  static bool
>  arc_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
>  {
> -  return to == FRAME_POINTER_REGNUM || !arc_frame_pointer_required ();
> +  return ((to == FRAME_POINTER_REGNUM) || !arc_frame_pointer_needed ());
>  }
>  
>  /* Define the offset between two registers, one to be eliminated, and
> -- 
> 1.9.1
>
Claudiu Zissulescu June 1, 2017, 9:46 a.m. UTC | #2
> Looks good,
> 

Committed, thank you,
Claudiu
diff mbox

Patch

diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 0c4c901..aac1952 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -4733,7 +4733,7 @@  arc_final_prescan_insn (rtx_insn *insn, rtx *opvec ATTRIBUTE_UNUSED,
 static bool
 arc_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to)
 {
-  return to == FRAME_POINTER_REGNUM || !arc_frame_pointer_required ();
+  return ((to == FRAME_POINTER_REGNUM) || !arc_frame_pointer_needed ());
 }
 
 /* Define the offset between two registers, one to be eliminated, and