2009-04-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37221
* tree-flow.h (degenerate_phi_result): Declare.
* tree-ssa-dom.c (degenerate_phi_result): Export.
* tree-scalar-evolution.c (analyze_initial_condition): If
the initial condition is defined by a degenerate PHI node
use the degenerate value.
* gcc.c-torture/compile/
20090331-1.c: New testcase.
From-SVN: r145439
+2009-04-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37221
+ * tree-flow.h (degenerate_phi_result): Declare.
+ * tree-ssa-dom.c (degenerate_phi_result): Export.
+ * tree-scalar-evolution.c (analyze_initial_condition): If
+ the initial condition is defined by a degenerate PHI node
+ use the degenerate value.
+
2009-04-01 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/39588
+2009-04-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37221
+ * gcc.c-torture/compile/20090331-1.c: New testcase.
+
2009-04-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20090401-1.c: New test.
--- /dev/null
+struct re_pattern_buffer {
+ unsigned char *buffer;
+ unsigned long int allocated;
+};
+void byte_regex_compile (struct re_pattern_buffer *bufp,
+ unsigned char *begalt, unsigned char *b)
+{
+ unsigned char *pfrom;
+ unsigned char *pto;
+
+ while ((unsigned long) (b - bufp->buffer + 3) > bufp->allocated)
+ {
+ unsigned char *old_buffer = bufp->buffer;
+ bufp->allocated <<= 1;
+ if (old_buffer != bufp->buffer)
+ {
+ int incr = bufp->buffer - old_buffer;
+ b += incr;
+ }
+ }
+ pfrom = b;
+ pto = b + 3;
+ while (pfrom != begalt)
+ *--pto = *--pfrom;
+}
+
extern void dump_dominator_optimization_stats (FILE *);
extern void debug_dominator_optimization_stats (void);
int loop_depth_of_name (tree);
+tree degenerate_phi_result (gimple);
/* In tree-ssa-copy.c */
extern void merge_alias_info (tree, tree);
if (init_cond == chrec_not_analyzed_yet)
init_cond = chrec_dont_know;
+ /* During early loop unrolling we do not have fully constant propagated IL.
+ Handle degenerate PHIs here to not miss important unrollings. */
+ if (TREE_CODE (init_cond) == SSA_NAME)
+ {
+ gimple def = SSA_NAME_DEF_STMT (init_cond);
+ tree res;
+ if (gimple_code (def) == GIMPLE_PHI
+ && (res = degenerate_phi_result (def)) != NULL_TREE
+ /* Only allow invariants here, otherwise we may break
+ loop-closed SSA form. */
+ && is_gimple_min_invariant (res))
+ init_cond = res;
+ }
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " (init_cond = ");
/* Given PHI, return its RHS if the PHI is a degenerate, otherwise return
NULL. */
-static tree
+tree
degenerate_phi_result (gimple phi)
{
tree lhs = gimple_phi_result (phi);