Commit e9d51dc6 by Xinliang David Li Committed by Xinliang David Li

Fix for PR39557

From-SVN: r145119
parent 4577cea1
2009-03-27 Xinliang David Li <davidxl@google.com>
PR tree-optimization/39557
* tree-ssa.c (warn_uninitialized_vars): free postdom info.
2009-03-27 Xinliang David Li <davidxl@google.com>
PR tree-optimization/39548
* tree-ssa-copy.c (copy_prop_visit_phi_node): Add copy
candidate check.
......
2009-03-27 Xinliang David Li <davidxl@google.com>
PR tree-optimization/39557
* g++.dg/tree-ssa/dom-invalid.C: New test.
2009-03-27 Xinliang David Li <davidxl@google.com>
PR tree-optimization/39548
* g++.dg/tree-ssa/copyprop.C: New test.
......
// PR tree-optimization/39557
// invalid post-dom info leads to infinite loop
// { dg-do run }
// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fno-rtti" }
struct C
{
virtual const char *bar () const;
};
struct D
{
D () : d1 (0) { }
C *d2[4];
int d1;
inline const C & baz (int i) const { return *d2[i]; }
};
struct E
{
unsigned char e1[2];
D e2;
bool foo () const { return (e1[1] & 1) != 0; }
virtual const char *bar () const __attribute__ ((noinline));
};
const char *
C::bar () const
{
return 0;
}
C c;
const char *
E::bar () const
{
const char *e = __null;
if (foo () && (e = c.C::bar ()))
return e;
for (int i = 0, n = e2.d1; i < n; i++)
if ((e = e2.baz (i).C::bar ()))
return e;
return e;
}
int
main ()
{
E e;
e.bar ();
} // { dg-message "note: file" "" }
......@@ -1589,6 +1589,11 @@ warn_uninitialized_vars (bool warn_possibly_uninitialized)
walk_gimple_op (gsi_stmt (gsi), warn_uninitialized_var, &wi);
}
}
/* Post-dominator information can not be reliably updated. Free it
after the use. */
free_dominance_info (CDI_POST_DOMINATORS);
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