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]

[PATCH] Fix count_one_set


Hello,

there seems to be an obvious bug in count_one_set function; it
seems to be harmless except that it increases the amount of work
to be done later unnecessarily.  I will commit the patch if it passes
testing.

Zdenek

Changelog:
	* loop.c (count_one_set): Fix detection of registers set in more
	than one basic block.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.431.2.10
diff -c -3 -p -r1.431.2.10 loop.c
*** loop.c	1 May 2003 09:55:42 -0000	1.431.2.10
--- loop.c	29 Jun 2003 18:25:17 -0000
*************** count_one_set (regs, insn, x, last_set)
*** 3542,3548 ****
  		 it must be set in two basic blocks, so it cannot
  		 be moved out of the loop.  */
  	      if (regs->array[regno].set_in_loop > 0
! 		  && last_set == 0)
  		regs->array[regno+i].may_not_optimize = 1;
  	      /* If this is not first setting in current basic block,
  		 see if reg was used in between previous one and this.
--- 3542,3548 ----
  		 it must be set in two basic blocks, so it cannot
  		 be moved out of the loop.  */
  	      if (regs->array[regno].set_in_loop > 0
! 		  && last_set[regno] == 0)
  		regs->array[regno+i].may_not_optimize = 1;
  	      /* If this is not first setting in current basic block,
  		 see if reg was used in between previous one and this.


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