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]

[3.4 PATCH] PR middle-end/19175: New RTL checking failures


The following patch resolves PR middle-end/19175 which are several
additional testsuite failures with an --enable-checking=rtl compiler
on the gcc-3_4-branch.  These new failures are regressions from previous
releases.

This problem was introduced only on the branch by the following patch:

2004-03-01  Mircea Namolaru  <namolaru@il.ibm.com>

        * loop-unroll.c: Include toplev.h
        (expand_bct): New function.
	...


The issue is a confusion over the GCC terminology "label", which refers
to a LABEL_REF in some functions, for example condjump_label, but to a
CODE_LABEL in others, such as do_jump or do_compare_rtx_and_jump.
In the function "expand_bct" (which is only on the gcc-3_4-branch),
the code was incorrectly passing a label_ref to do_compare_rtx_and_jump.
It was also directly tweaking JUMP_LABEL (get_last_insn ()) which looks
suspicious/unnecessary [If it wasn't for this bit, I'd have committed
the following patch myself].

I had difficulty finding the review and/or approval of the above
patch, which also contains several minor style issues in expand_bct
which I've taken the liberty of addressing in the patch below.


The following patch has been tested against the gcc-3_4-branch with a
full "make bootstrap", all default languages and regression tested with
a top-level "make -k check" with no new failures.  I've also confirmed
that this patch allows bootstrap/regression testing to pass with no
additional failures with a suitable asserts in do_compare_rtx_and_jump
(which was much faster to test than a full --enable-checking cycle).

Ok for the gcc-3_4-branch?



2004-12-28  Roger Sayle  <roger@eyesopen.com>

	PR middle-end/19175
	* loop-unroll.c (expand_bct): Pass the code_label to the function
	do_compare_rtx_and_jump, not the label ref.  Clean-up style issues.


Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unroll.c,v
retrieving revision 1.13.4.2
diff -c -3 -p -r1.13.4.2 loop-unroll.c
*** loop-unroll.c	2 Mar 2004 02:25:06 -0000	1.13.4.2
--- loop-unroll.c	28 Dec 2004 17:21:58 -0000
*************** unroll_loop_stupid (struct loops *loops,
*** 1269,1275 ****
  /* Expand a bct instruction in a branch and an increment.
     If flag_inc is set, the induction variable does not need to be
     incremented.  */
! void expand_bct (edge e, int flag_inc)
  {
    rtx bct_insn = BB_END (e->src);
    rtx cmp;
--- 1269,1277 ----
  /* Expand a bct instruction in a branch and an increment.
     If flag_inc is set, the induction variable does not need to be
     incremented.  */
!
! static void
! expand_bct (edge e, int flag_inc)
  {
    rtx bct_insn = BB_END (e->src);
    rtx cmp;
*************** void expand_bct (edge e, int flag_inc)
*** 1278,1289 ****

    rtx tgt;
    rtx condition;
!   rtx label;
    rtx reg;
!   rtx jump;
!   rtx pattern = PATTERN(bct_insn);

!   if (!(is_bct_cond(bct_insn)))
      return;

    inc = get_var_set_from_bct (bct_insn);
--- 1280,1290 ----

    rtx tgt;
    rtx condition;
!   rtx labelref;
    rtx reg;
!   rtx pattern = PATTERN (bct_insn);

!   if (!is_bct_cond (bct_insn))
      return;

    inc = get_var_set_from_bct (bct_insn);
*************** void expand_bct (edge e, int flag_inc)
*** 1299,1312 ****
      }

    condition = XEXP (SET_SRC (cmp), 0);
!   label = XEXP (SET_SRC (cmp), 1);

    do_compare_rtx_and_jump (copy_rtx (reg), XEXP (condition, 1),
  			   GET_CODE (condition), 0,
  			   GET_MODE (reg), NULL_RTX, NULL_RTX,
! 			   label);
!   jump = get_last_insn ();
!   JUMP_LABEL (jump) = label;
    seq = get_insns ();
    end_sequence ();
    emit_insn_after (seq, bct_insn);
--- 1300,1311 ----
      }

    condition = XEXP (SET_SRC (cmp), 0);
!   labelref = XEXP (SET_SRC (cmp), 1);

    do_compare_rtx_and_jump (copy_rtx (reg), XEXP (condition, 1),
  			   GET_CODE (condition), 0,
  			   GET_MODE (reg), NULL_RTX, NULL_RTX,
! 			   XEXP (labelref, 0));
    seq = get_insns ();
    end_sequence ();
    emit_insn_after (seq, bct_insn);


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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