This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[arm] Remove dead code.


Patch below removes some dead code from the prologue generation routines. 
These cases are already handled by the if statement immediately above.

I've done a bit of digging and the discrepancy between the two (LR vs PC), 
seems to be from before we included pc when doing multiple register reg 
loads.

Tested with cross to arm-none-elf.
Ok?

Paul

2004-05-27  Paul Brook  <paul@codesourcery.com>

	* config/arm/arm.c (arm_output_epilogue): Remove redundant code.

Index: arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.363
diff -u -p -r1.363 arm.c
--- arm.c	25 May 2004 21:43:53 -0000	1.363
+++ arm.c	27 May 2004 16:45:44 -0000
@@ -9704,6 +9704,7 @@ arm_output_epilogue (rtx sibling)
 	}
     }
 
+  /* We may have already restored PC directly from the stack.  */
   if (! really_return
     || (ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
 	&& current_function_pretend_args_size == 0
@@ -9733,19 +9734,7 @@ arm_output_epilogue (rtx sibling)
       break;
 
     default:
-      if (frame_pointer_needed)
-	/* If we used the frame pointer then the return address
-	   will have been loaded off the stack directly into the
-	   PC, so there is no need to issue a MOV instruction
-	   here.  */
-	;
-      else if (current_function_pretend_args_size == 0
-	       && (saved_regs_mask & (1 << LR_REGNUM)))
-	/* Similarly we may have been able to load LR into the PC
-	   even if we did not create a stack frame.  */
-	;
-      else
-	asm_fprintf (f, "\tmov\t%r, %r\n", PC_REGNUM, LR_REGNUM);
+      asm_fprintf (f, "\tmov\t%r, %r\n", PC_REGNUM, LR_REGNUM);
       break;
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]