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] tree-cfg.c: Clean up cleanup_tree_cfg().


Hi,

Attached is a patch to clean up cleanup_tree_cfg() as I have made the
control structure of the while loop unnecessarily complicated in my
previous patch.

The patch fixes the problem by removing variable something_changed.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-10-03  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-cfg.c (cleanup_tree_cfg): Remove variable
	something_changed.  Simplify the while loop.

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.64
diff -c -r2.64 tree-cfg.c
*** tree-cfg.c	2 Oct 2004 12:47:10 -0000	2.64
--- tree-cfg.c	2 Oct 2004 13:06:20 -0000
***************
*** 712,718 ****
  bool
  cleanup_tree_cfg (void)
  {
-   bool something_changed = true;
    bool retval = false;
  
    timevar_push (TV_TREE_CLEANUP_CFG);
--- 712,717 ----
***************
*** 723,738 ****
    /* thread_jumps() sometimes leaves further transformation
       opportunities for itself, so iterate on it until nothing
       changes.  */
!   while (something_changed)
      {
-       something_changed = thread_jumps ();
- 
        /* delete_unreachable_blocks() does its job only when
  	 thread_jumps() produces more unreachable blocks.  */
!       if (something_changed)
! 	delete_unreachable_blocks ();
! 
!       retval |= something_changed;
      }
  
  #ifdef ENABLE_CHECKING
--- 722,733 ----
    /* thread_jumps() sometimes leaves further transformation
       opportunities for itself, so iterate on it until nothing
       changes.  */
!   while (thread_jumps ())
      {
        /* delete_unreachable_blocks() does its job only when
  	 thread_jumps() produces more unreachable blocks.  */
!       delete_unreachable_blocks ();
!       retval = true;
      }
  
  #ifdef ENABLE_CHECKING


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