Commit 7a6b7528 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/23454 (ICE in invert_exp_1, at jump.c:1719)

	PR rtl-optimization/23454
	* reorg.c (relax_delay_slots): Only call invert_jump if any_condjump_p
	is true.

	* g++.dg/opt/pr23454.C: New test.

From-SVN: r103810
parent f7e4e484
2005-09-03 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/23454
* reorg.c (relax_delay_slots): Only call invert_jump if any_condjump_p
is true.
2005-09-03 Richard Henderson <rth@redhat.com> 2005-09-03 Richard Henderson <rth@redhat.com>
John David Anglin <dave.anglin@nrc-cnrc.gc.ca> John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
......
...@@ -3123,10 +3123,11 @@ relax_delay_slots (rtx first) ...@@ -3123,10 +3123,11 @@ relax_delay_slots (rtx first)
if (target_label && target_label != JUMP_LABEL (insn)) if (target_label && target_label != JUMP_LABEL (insn))
reorg_redirect_jump (insn, target_label); reorg_redirect_jump (insn, target_label);
/* See if this jump branches around an unconditional jump. /* See if this jump conditionally branches around an unconditional
If so, invert this jump and point it to the target of the jump. If so, invert this jump and point it to the target of the
second jump. */ second jump. */
if (next && JUMP_P (next) if (next && JUMP_P (next)
&& any_condjump_p (insn)
&& (simplejump_p (next) || GET_CODE (PATTERN (next)) == RETURN) && (simplejump_p (next) || GET_CODE (PATTERN (next)) == RETURN)
&& target_label && target_label
&& next_active_insn (target_label) == next_active_insn (next) && next_active_insn (target_label) == next_active_insn (next)
...@@ -3172,7 +3173,7 @@ relax_delay_slots (rtx first) ...@@ -3172,7 +3173,7 @@ relax_delay_slots (rtx first)
if (JUMP_P (insn) if (JUMP_P (insn)
&& (simplejump_p (insn) || GET_CODE (PATTERN (insn)) == RETURN) && (simplejump_p (insn) || GET_CODE (PATTERN (insn)) == RETURN)
&& (other = prev_active_insn (insn)) != 0 && (other = prev_active_insn (insn)) != 0
&& (condjump_p (other) || condjump_in_parallel_p (other)) && any_condjump_p (other)
&& no_labels_between_p (other, insn) && no_labels_between_p (other, insn)
&& 0 > mostly_true_jump (other, && 0 > mostly_true_jump (other,
get_branch_condition (other, get_branch_condition (other,
......
2005-09-03 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/23454
* g++.dg/opt/pr23454.C: New test.
2005-09-03 Mark Mitchell <mark@codesourcery.com> 2005-09-03 Mark Mitchell <mark@codesourcery.com>
PR c++/23699 PR c++/23699
/* PR rtl-optimization/23454 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
void foo ();
int a, b;
char c;
long long d, e;
static inline int
bar (const long long s, const long long t)
{
return ((s < t) ? -1 : s > t ? 1 : 0);
}
int fn ();
int f;
void
baz (int x)
{
long long g = fn ();
if (f)
{
b++;
return;
}
if (g == 0)
a++;
if (x)
foo ();
if (!c)
c = 1;
else if (g != 0)
{
if (bar (g, d) < 0)
d = g;
if (bar (g, e) > 0)
e = g;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment