This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/3053: crash on armlinux and conditional execution
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: optimization/3053: crash on armlinux and conditional execution
- From: Richard Henderson <rth at redhat dot com>
- Date: Mon, 11 Jun 2001 14:36:24 -0700
- References: <20010611141454.A23710@redhat.com>
I found one other spot that needed adjustment.
r~
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.37.4.5
diff -c -p -d -r1.37.4.5 ifcvt.c
*** ifcvt.c 2001/06/11 05:15:15 1.37.4.5
--- ifcvt.c 2001/06/11 21:34:45
*************** cond_exec_get_condition (jump)
*** 288,296 ****
reverse the condition. */
if (GET_CODE (XEXP (test_if, 2)) == LABEL_REF
&& XEXP (XEXP (test_if, 2), 0) == JUMP_LABEL (jump))
! cond = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)),
! GET_MODE (cond), XEXP (cond, 0),
! XEXP (cond, 1));
return cond;
}
--- 288,301 ----
reverse the condition. */
if (GET_CODE (XEXP (test_if, 2)) == LABEL_REF
&& XEXP (XEXP (test_if, 2), 0) == JUMP_LABEL (jump))
! {
! enum rtx_code rev = reversed_comparison_code (cond, jump);
! if (rev == UNKNOWN)
! return NULL_RTX;
!
! cond = gen_rtx_fmt_ee (rev, GET_MODE (cond), XEXP (cond, 0),
! XEXP (cond, 1));
! }
return cond;
}
*************** cond_exec_process_if_block (test_bb, the
*** 318,323 ****
--- 323,329 ----
rtx true_prob_val; /* probability of else block */
rtx false_prob_val; /* probability of then block */
int n_insns;
+ enum rtx_code false_code;
/* Find the conditional jump to the ELSE or JOIN part, and isolate
the test. */
*************** cond_exec_process_if_block (test_bb, the
*** 379,388 ****
the conditionally executed code. */
true_expr = test_expr;
- false_expr = gen_rtx_fmt_ee (reverse_condition (GET_CODE (true_expr)),
- GET_MODE (true_expr), XEXP (true_expr, 0),
- XEXP (true_expr, 1));
#ifdef IFCVT_MODIFY_TESTS
/* If the machine description needs to modify the tests, such as setting a
conditional execution register from a comparison, it can do so here. */
--- 385,398 ----
the conditionally executed code. */
true_expr = test_expr;
+ false_code = reversed_comparison_code (true_expr, test_bb->end);
+ if (false_code != UNKNOWN)
+ false_expr = gen_rtx_fmt_ee (false_code, GET_MODE (true_expr),
+ XEXP (true_expr, 0), XEXP (true_expr, 1));
+ else
+ false_expr = NULL_RTX;
+
#ifdef IFCVT_MODIFY_TESTS
/* If the machine description needs to modify the tests, such as setting a
conditional execution register from a comparison, it can do so here. */
*************** cond_exec_process_if_block (test_bb, the
*** 411,418 ****
to conditional execution. */
if (then_end
! && ! cond_exec_process_insns (then_start, then_end,
! false_expr, false_prob_val, then_mod_ok))
goto fail;
if (else_bb
--- 421,429 ----
to conditional execution. */
if (then_end
! && (! false_expr
! || ! cond_exec_process_insns (then_start, then_end, false_expr,
! false_prob_val, then_mod_ok)))
goto fail;
if (else_bb
*************** dead_or_predicable (test_bb, merge_bb, o
*** 1938,1943 ****
--- 1949,1956 ----
rtx cond, prob_val;
cond = cond_exec_get_condition (jump);
+ if (! cond)
+ return FALSE;
prob_val = find_reg_note (jump, REG_BR_PROB, NULL_RTX);
if (prob_val)
*************** dead_or_predicable (test_bb, merge_bb, o
*** 1945,1952 ****
if (reversep)
{
! cond = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)),
! GET_MODE (cond), XEXP (cond, 0),
XEXP (cond, 1));
if (prob_val)
prob_val = GEN_INT (REG_BR_PROB_BASE - INTVAL (prob_val));
--- 1958,1967 ----
if (reversep)
{
! enum rtx_code rev = reversed_comparison_code (cond, jump);
! if (rev == UNKNOWN)
! return NULL_RTX;
! cond = gen_rtx_fmt_ee (rev, GET_MODE (cond), XEXP (cond, 0),
XEXP (cond, 1));
if (prob_val)
prob_val = GEN_INT (REG_BR_PROB_BASE - INTVAL (prob_val));