re PR rtl-optimization/8848 (bad code when optimizing (lifetime analysis pass?))

PR opt/8848
        * ifcvt.c (noce_process_if_block): Correct arguments to
        modified_between_p for no-else-block case.
        * gcc.c-torture/execute/20030120-2.c: New.

From-SVN: r61532
This commit is contained in:
Richard Henderson 2003-01-20 21:04:34 -08:00 committed by Richard Henderson
parent 9ac7ebba1c
commit 7a174a1534
3 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-01-20 Richard Henderson <rth@redhat.com>
PR opt/8848
* ifcvt.c (noce_process_if_block): Correct arguments to
modified_between_p for no-else-block case.
2003-01-20 Kazu Hirata <kazu@cs.umass.edu> 2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (const_costs): Remove a warning. * config/h8300/h8300.c (const_costs): Remove a warning.

View File

@ -1809,7 +1809,8 @@ noce_process_if_block (ce_info)
|| reg_overlap_mentioned_p (x, cond) || reg_overlap_mentioned_p (x, cond)
|| reg_overlap_mentioned_p (x, a) || reg_overlap_mentioned_p (x, a)
|| reg_overlap_mentioned_p (x, SET_SRC (set_b)) || reg_overlap_mentioned_p (x, SET_SRC (set_b))
|| modified_between_p (x, if_info.cond_earliest, NEXT_INSN (jump))) || modified_between_p (SET_SRC (set_b),
PREV_INSN (if_info.cond_earliest), jump))
insn_b = set_b = NULL_RTX; insn_b = set_b = NULL_RTX;
} }
b = (set_b ? SET_SRC (set_b) : x); b = (set_b ? SET_SRC (set_b) : x);

View File

@ -0,0 +1,19 @@
/* PR 8848 */
extern void abort ();
int foo(int status)
{
int s = 0;
if (status == 1) s=1;
if (status == 3) s=3;
if (status == 4) s=4;
return s;
}
int main()
{
if (foo (3) != 3)
abort ();
return 0;
}