This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/47271] [4.6 Regression] if-conversion removes a test (if), the function generates invalid outputs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47271

--- Comment #8 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-24 18:34:38 UTC ---
The translation in predicate_all_scalar_phis assumes that the incoming
edges OR up to true: it translates a phi node

x = phi (y, z)

into

x = a ? y : z;

In the testcase of this PR, the conditions of the two edges is not
ORing up to true: we have something like this:

x = a ? y : x;
x = (!a and b) ? z : x;

this is because we have a CFG containing diamond shape, and the write
into x does not happen at every execution of the loop: (a and !b)
should not modify the value of x.

A possible solution is to filter out these cases in predicate_bbs.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]