REGRESSION in 3.2.1-pre on mips-irix6 (and elsewhere) compiling execute/20011219-1.c

Jan Hubicka jh@suse.cz
Thu Nov 14 12:26:00 GMT 2002


> >  > From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
> >  > 
> >  > >ChangeLog
> >  > >
> >  > >       * flow.c(life_analysis): Update LABEL_NUSES before purging
> >  > >       dead jumptables.
> >  > 
> >  > This patch has no effect on powerpc-linux-gnu, both testcases still
> >  > fail in the same way.
> >  > Franz.
> > 
> > That's unfortunate, since on mips-irix6.5 the patch passed 3-stage
> > bootstrap & testsuite with no regressions.
> OK, To not let you to fix everything, I wil take a look at the PPC then.
Survived PPC bootstrap.
I would bet we do ahve function to recognize tablejumps but apparently
we don't...

Thu Nov 14 13:23:58 MST 2002  JAn Hubicka  <jh@suse.cz>
	* jump.c (tablejump_p): New.
	* cfgcleanup.c (try_optimize_cfg): Do not merge blocks across tablejump.
	* rtl.h (tablejump_p): Declare.
*** /home/fsirl/cvsx/gcc32/gcc/jump.c	2002-10-05 01:17:41.000000000 -0700
--- jump.c	2002-11-14 13:18:07.000000000 -0700
*************** simplejump_p (insn)
*** 1076,1081 ****
--- 1076,1096 ----
  	  && GET_CODE (SET_DEST (PATTERN (insn))) == PC
  	  && GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF);
  }
+ /* Return 1 if INSN is an tablejump.  */
+ 
+ int
+ tablejump_p (insn)
+      rtx insn;
+ {
+   rtx table;
+   return (GET_CODE (insn) == JUMP_INSN
+ 	  && JUMP_LABEL (insn)
+ 	  && NEXT_INSN (JUMP_LABEL (insn))
+ 	  && (table = next_active_insn (JUMP_LABEL (insn)))
+ 	  && GET_CODE (table) == JUMP_INSN
+ 	  && (GET_CODE (PATTERN (table)) == ADDR_VEC
+ 	      || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC));
+ }
  
  /* Return nonzero if INSN is a (possibly) conditional jump
     and nothing more.
*** /home/fsirl/cvsx/gcc32/gcc/cfgcleanup.c	2002-06-13 13:48:39.000000000 -0700
--- cfgcleanup.c	2002-11-14 13:09:09.000000000 -0700
*************** try_optimize_cfg (mode)
*** 1638,1644 ****
  		     /* If the jump insn has side effects,
  			we can't kill the edge.  */
  		     && (GET_CODE (b->end) != JUMP_INSN
! 			 || onlyjump_p (b->end))
  		     && merge_blocks (s, b, c, mode))
  		changed_here = true;
  
--- 1638,1645 ----
  		     /* If the jump insn has side effects,
  			we can't kill the edge.  */
  		     && (GET_CODE (b->end) != JUMP_INSN
! 			 || (onlyjump_p (b->end)
! 			     && !tablejump_p (b->end)))
  		     && merge_blocks (s, b, c, mode))
  		changed_here = true;
  
*** /home/fsirl/cvsx/gcc32/gcc/rtl.h	2002-10-05 01:17:43.000000000 -0700
--- rtl.h	2002-11-14 13:01:27.000000000 -0700
*************** extern rtx pc_set			PARAMS ((rtx));
*** 1804,1809 ****
--- 1804,1810 ----
  extern rtx condjump_label		PARAMS ((rtx));
  extern int simplejump_p			PARAMS ((rtx));
  extern int returnjump_p			PARAMS ((rtx));
+ extern int tablejump_p			PARAMS ((rtx));
  extern int onlyjump_p			PARAMS ((rtx));
  extern int only_sets_cc0_p		PARAMS ((rtx));
  extern int sets_cc0_p			PARAMS ((rtx));



More information about the Gcc-bugs mailing list