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]

Re: Don't eliminate constant-equivalent registers at O0


Geoffrey Keating <geoffk@thief.cygnus.com> writes:

> In code like
> 
> ..
>   return 0;
> }
> 
> GCC was eliminating the code for the 'return 0' line, even at -O0.
> This prevents the optimisation.
> 
> Tested on powerpc-eabisim gdb, bootstrap running on x86-linux.

The bootstrap failed :-(.

This patch does the same thing, but doesn't break the bootstrap.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

--------------------
2001-05-26  Geoffrey Keating  <geoffk@redhat.com>

	* local-alloc.c (update_equiv_regs): Don't eliminate constant
	expressions at -O0.

Index: local-alloc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/local-alloc.c,v
retrieving revision 1.79
diff -p -u -p -r1.79 local-alloc.c
--- local-alloc.c	2001/04/03 15:05:22	1.79
+++ local-alloc.c	2001/05/28 02:19:12
@@ -1005,7 +1005,7 @@ update_equiv_regs ()
 	  reg_equiv[regno].loop_depth = loop_depth;
 
 	  /* Don't mess with things live during setjmp.  */
-	  if (REG_LIVE_LENGTH (regno) >= 0)
+	  if (REG_LIVE_LENGTH (regno) >= 0 && optimize)
 	    {
 	      /* Note that the statement below does not affect the priority
 		 in local-alloc!  */
--------------------


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