Bugfix to cse.c

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sun Feb 27 06:09:00 GMT 2000


The following change:

    Fri Feb 25 19:49:08 2000  Jeffrey A Law  (law@cygnus.com)

	* cse.c (cse_insn): Replace the PATTERN of the insn with an new
	jump when changing a computed jump into a jump to a known
	target.

had two bugs.  First, gen_jump should be passed a CODE_LABEL, not a
LABEL_REF.  Secondly, INSN_CODE needs to be reset.

Also, the large "if" statement above that code makes no sense, has
been there for ages, and is dead code since TRIAL cannot be a
CODE_LABEL there.  I suspect this statement was at least partially
responsible for the above confusion, so I deleted it.

I committed the following patch:

Sun Feb 27 07:44:17 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* cse.c (cse_insn): Delete dead code involving tablejump.
	Pass CODE_LABEL, not LABEL_REF to gen_jump and reset INSN_CODE.

*** cse.c	2000/02/26 05:59:31	1.131
--- cse.c	2000/02/27 14:04:01
*************** cse_insn (insn, libcall_insn)
*** 5198,5212 ****
  		      && ! condjump_p (insn))))
  	    {
- 	      /* If TRIAL is a label in front of a jump table, we are
- 		 really falling through the switch (this is how casesi
- 		 insns work), so we must branch around the table.  */
- 	      if (GET_CODE (trial) == CODE_LABEL
- 		  && NEXT_INSN (trial) != 0
- 		  && GET_CODE (NEXT_INSN (trial)) == JUMP_INSN
- 		  && (GET_CODE (PATTERN (NEXT_INSN (trial))) == ADDR_DIFF_VEC
- 		      || GET_CODE (PATTERN (NEXT_INSN (trial))) == ADDR_VEC))
- 
- 		trial = gen_rtx_LABEL_REF (Pmode, get_label_after (trial));
- 
  	      if (trial == pc_rtx)
  		{
--- 5198,5201 ----
*************** cse_insn (insn, libcall_insn)
*** 5216,5220 ****
  		}
  
! 	      PATTERN (insn) = gen_jump (trial);
  	      cse_jumps_altered = 1;
  	      break;
--- 5205,5210 ----
  		}
  
! 	      PATTERN (insn) = gen_jump (XEXP (trial, 0));
! 	      INSN_CODE (insn) = -1;
  	      cse_jumps_altered = 1;
  	      break;


More information about the Gcc-patches mailing list