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]

Bug fix for optimize_mode_switching / NORMAL_MODE


Since May 2000, optimize_mode_switching has some code to pretend that
the exit block is an ordinary block when NORMAL_MODE is defined.
This does not mix with the new FOR_EACH_BB / FOR_EACH_BB_REVERSE macros.
We can either restore lcm to the state where it doesn't fiddle with the
basic block array, or make the FOR_EACH_BB* macros cope with that.
The included patch implements the latter.

-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
Since May 2000, optimize_mode_switching has some code to pretend that
the exit block is an ordinary block when NORMAL_MODE is defined.
This does not mix with the new FOR_EACH_BB / FOR_EACH_BB_REVERSE macros.
We can either restore lcm to the state where it doesn't fiddle with the
basic block array, or make the FOR_EACH_BB* macros cope with that.
The included patch implements the latter.

Mon May 27 23:22:51 2002  J"orn Rennecke <joern.rennecke@superh.com>

	* lcm.c (FOR_EACH_BB): Redefine for NORMAL_MODE.
	(FOR_EACH_BB_REVERSE): Likewise.

Index: lcm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lcm.c,v
retrieving revision 1.45
diff -p -r1.45 lcm.c
*** lcm.c	27 May 2002 13:45:30 -0000	1.45
--- lcm.c	27 May 2002 22:22:42 -0000
*************** Software Foundation, 59 Temple Place - S
*** 61,66 ****
--- 61,76 ----
  #include "basic-block.h"
  #include "tm_p.h"
  
+ #ifdef NORMAL_MODE
+ #undef FOR_EACH_BB
+ #define FOR_EACH_BB(BB) \
+   for (BB = ENTRY_BLOCK_PTR->next_bb; BB && BB->index >= 0; BB = BB->next_bb)
+ #undef FOR_EACH_BB_REVERSE
+ #define FOR_EACH_BB_REVERSE(BB) \
+   for (BB = BASIC_BLOCK (last_basic_block-1); BB != ENTRY_BLOCK_PTR; \
+        BB = BB->prev_bb)
+ #endif
+ 
  /* We want target macros for the mode switching code to be able to refer
     to instruction attribute values.  */
  #include "insn-attr.h"

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