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]

Fix PR/12863


Hello,

this patch fixes the remaining testsuite failures in PR/12863
(at least gcc.c-torture/compile/20020116-1.c, the other one
worked yesterday (testsuite/gcc.c-torture/execute/20011109-1.c))
in vax crosscompiler.

The problem in gcc.c-torture/compile/20020116-1.c is that the
block which is destination of the fallthru edge of the tablejump
does not have label. The execution reaches redirect_edge_succ_nodup
in cfg_layout_redirect_edge_and_branch and merges the fallthru edge
with one of the tablejump edges. The tablejump edge is marked fallthru
and the label is not emitted.

This patch forces it not to redirect fallthru edge of the tablejump.

Bootstrapped/regtested x86-64.
Please could someone test it on vax?

Josef

Part of the assembler for more reduced testcase:
without patch:                       with patch:

        casel r0,$102,$5                     casel r0,$102,$5
L9:                                  L9:
        .word L6-L9                          .word L6-L9
        .word L8-L9                          .word L8-L9
        .word L12-L9                         .word L16-L9
        .word L6-L9                          .word L6-L9
        .word L12-L9                         .word L16-L9
        .word L7-L9                          .word L7-L9
        jbr L16                              jbr L16
L6:                                  L6:     
        movl _b,_a                           movl _b,_a
        jbr L16                              jbr L16
L7:                                  L7:
        movl $1,_d                           movl $1,_d
        jbr L16                              jbr L16
L8:                                  L8:
        clrl _d                              clrl _d
L16:                                 L16:
        pushl r6                             pushl r6
        pushl r7                             pushl r7

Label L12 is undefined.              This is correct.


2004-03-21  Josef Zlomek  <zlomekj@suse.cz>

	* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Do not
	redirect the fallthru edge of the tablejump.

Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 cfgrtl.c
*** cfgrtl.c	17 Mar 2004 11:42:10 -0000	1.112
--- cfgrtl.c	20 Mar 2004 15:31:56 -0000
*************** cfg_layout_redirect_edge_and_branch (edg
*** 2428,2433 ****
--- 2428,2437 ----
            e->src->flags |= BB_DIRTY;
  	  return true;
  	}
+       /* We do not want to redirect the fallthru edge of tablejump.  */
+       if (GET_CODE (BB_END (src)) == JUMP_INSN
+ 	  && tablejump_p (BB_END (src), NULL, NULL))
+ 	return false;
        /* In case we are redirecting fallthru edge to the branch edge
           of conditional jump, remove it.  */
        if (src->succ->succ_next


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