On Fri, May 13, 2011 at 3:17 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Thu, May 12, 2011 at 11:59 PM, Kai Tietz <ktiet...@googlemail.com> wrote: >> Hello, >> >> this patch fixes the issue reported in PR/48984. Issue is that >> fortran has multiple BOOLEAN_TYPE'ed types with different modes. So >> the check for BOOLEAN_TYPE in gimplification is wrong and instead we >> need to check for identify to boolean_type_node. >> >> ChangeLog >> >> 2011-05-13 Kai Tietz >> >> * gimplify.c (gimplify_expr): Check for boolean_type_node instead >> for BOOLEAN_TYPE for TRUTH-NOT/AND/OR/XOR. >> (gimple_boolify): Check for cast for boolean_type_node instead for >> BOOLEAN_TYPE. >> >> Bootstrap passed and now doing fortran testsuite run to verify. > > It isn't completed fixed. I still got > > FAIL: gcc.dg/tree-ssa/vrp47.c scan-tree-dump-times dom1 "x[^ ]* & y" 1 > > with revision 173729.
That's now D.2716_9 = (_Bool) x_2(D); D.2717_10 = (_Bool) y_5(D); D.2718_11 = D.2716_9 & D.2717_10; D.2715_12 = (int) D.2718_11; instead of x_9 = x_2(D); y_10 = y_5(D); D.2715_11 = x_2(D) & y_5(D); before. VRP does not optimize the above to the latter even if it would know that x_2 and y_5 are both [0,1] (for some reason it thinks they are varying). Before VRP we had D.2716_9 = x_13 != 0; D.2717_10 = y_14 != 0; D.2715_11 = D.2716_9 && D.2717_10; which helped VRP see that for _9 and _10 and thus it folded the truth and to a bitwise and test. This kind of fallout is expected but we should find a way to address it. Richard. > -- > H.J. >