Commit b5482208 by Richard Henderson

ifcvt.c (noce_try_store_flag, [...]): Insert new code before JUMP, not EARLIEST.

        * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
        noce_try_store_flag_inc, noce_try_store_flag_mask, noce_try_cmove,
        noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Insert new
        code before JUMP, not EARLIEST.

From-SVN: r53123
parent ba2e86d6
2002-05-03 Richard Henderson <rth@redhat.com>
PR opt/6534
* ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
noce_try_store_flag_inc, noce_try_store_flag_mask, noce_try_cmove,
noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Insert new
code before JUMP, not EARLIEST.
2002-05-03 Joseph S. Myers <jsm28@cam.ac.uk> 2002-05-03 Joseph S. Myers <jsm28@cam.ac.uk>
* c-format.c (check_format_info_main): Don't check for presence of * c-format.c (check_format_info_main): Don't check for presence of
...@@ -147,10 +155,10 @@ Thu May 2 19:50:04 CEST 2002 Jan Hubicka <jh@suse.cz> ...@@ -147,10 +155,10 @@ Thu May 2 19:50:04 CEST 2002 Jan Hubicka <jh@suse.cz>
2002-05-02 Aldy Hernandez <aldyh@redhat.com> 2002-05-02 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/altivec-8.c: New. * gcc.dg/altivec-8.c: New.
* config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow
PRE_INC and PRE_DEC for altivec modes. PRE_INC and PRE_DEC for altivec modes.
2002-05-01 Bruce Korb <bkorb@gnu.org> 2002-05-01 Bruce Korb <bkorb@gnu.org>
......
...@@ -620,7 +620,7 @@ noce_try_store_flag (if_info) ...@@ -620,7 +620,7 @@ noce_try_store_flag (if_info)
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->jump);
return TRUE; return TRUE;
} }
...@@ -755,7 +755,7 @@ noce_try_store_flag_constants (if_info) ...@@ -755,7 +755,7 @@ noce_try_store_flag_constants (if_info)
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->jump);
return TRUE; return TRUE;
} }
...@@ -815,7 +815,7 @@ noce_try_store_flag_inc (if_info) ...@@ -815,7 +815,7 @@ noce_try_store_flag_inc (if_info)
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->jump);
return TRUE; return TRUE;
} }
...@@ -867,7 +867,7 @@ noce_try_store_flag_mask (if_info) ...@@ -867,7 +867,7 @@ noce_try_store_flag_mask (if_info)
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->jump);
return TRUE; return TRUE;
} }
...@@ -962,7 +962,7 @@ noce_try_cmove (if_info) ...@@ -962,7 +962,7 @@ noce_try_cmove (if_info)
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->jump);
return TRUE; return TRUE;
} }
else else
...@@ -1124,7 +1124,7 @@ noce_try_cmove_arith (if_info) ...@@ -1124,7 +1124,7 @@ noce_try_cmove_arith (if_info)
tmp = get_insns (); tmp = get_insns ();
end_sequence (); end_sequence ();
emit_insns_before (tmp, if_info->cond_earliest); emit_insns_before (tmp, if_info->jump);
return TRUE; return TRUE;
end_seq_and_fail: end_seq_and_fail:
...@@ -1376,7 +1376,7 @@ noce_try_minmax (if_info) ...@@ -1376,7 +1376,7 @@ noce_try_minmax (if_info)
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
emit_insns_before (seq, earliest); emit_insns_before (seq, if_info->jump);
if_info->cond = cond; if_info->cond = cond;
if_info->cond_earliest = earliest; if_info->cond_earliest = earliest;
...@@ -1494,7 +1494,7 @@ noce_try_abs (if_info) ...@@ -1494,7 +1494,7 @@ noce_try_abs (if_info)
if (seq_contains_jump (seq)) if (seq_contains_jump (seq))
return FALSE; return FALSE;
emit_insns_before (seq, earliest); emit_insns_before (seq, if_info->jump);
if_info->cond = cond; if_info->cond = cond;
if_info->cond_earliest = earliest; if_info->cond_earliest = earliest;
...@@ -1753,7 +1753,7 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb) ...@@ -1753,7 +1753,7 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb)
if (insn_b && else_bb) if (insn_b && else_bb)
delete_insn (insn_b); delete_insn (insn_b);
/* The new insns will have been inserted before cond_earliest. We should /* The new insns will have been inserted just before the jump. We should
be able to remove the jump with impunity, but the condition itself may be able to remove the jump with impunity, but the condition itself may
have been modified by gcse to be shared across basic blocks. */ have been modified by gcse to be shared across basic blocks. */
delete_insn (jump); delete_insn (jump);
......
/* PR 6534 */
/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
insertted the code at the wrong place corrupting the i<0 test. */
void abort (void);
static char *
inttostr (long i, char buf[128])
{
unsigned long ui = i;
char *p = buf + 127;
*p = '\0';
if (i < 0)
ui = -ui;
do
*--p = '0' + ui % 10;
while ((ui /= 10) != 0);
if (i < 0)
*--p = '-';
return p;
}
int
main ()
{
char buf[128], *p;
p = inttostr (-1, buf);
if (*p != '-')
abort ();
return 0;
}
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