+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>
* c-format.c (check_format_info_main): Don't check for presence of
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
- PRE_INC and PRE_DEC for altivec modes.
+ * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow
+ PRE_INC and PRE_DEC for altivec modes.
2002-05-01 Bruce Korb <bkorb@gnu.org>
seq = get_insns ();
end_sequence ();
- emit_insns_before (seq, if_info->cond_earliest);
+ emit_insns_before (seq, if_info->jump);
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->cond_earliest);
+ emit_insns_before (seq, if_info->jump);
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->cond_earliest);
+ emit_insns_before (seq, if_info->jump);
return TRUE;
}
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, if_info->cond_earliest);
+ emit_insns_before (seq, if_info->jump);
return TRUE;
}
seq = get_insns ();
end_sequence ();
- emit_insns_before (seq, if_info->cond_earliest);
+ emit_insns_before (seq, if_info->jump);
return TRUE;
}
else
tmp = get_insns ();
end_sequence ();
- emit_insns_before (tmp, if_info->cond_earliest);
+ emit_insns_before (tmp, if_info->jump);
return TRUE;
end_seq_and_fail:
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, earliest);
+ emit_insns_before (seq, if_info->jump);
if_info->cond = cond;
if_info->cond_earliest = earliest;
if (seq_contains_jump (seq))
return FALSE;
- emit_insns_before (seq, earliest);
+ emit_insns_before (seq, if_info->jump);
if_info->cond = cond;
if_info->cond_earliest = earliest;
if (insn_b && else_bb)
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
have been modified by gcse to be shared across basic blocks. */
delete_insn (jump);
--- /dev/null
+/* 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;
+}