------- Comment #3 from rguenth at gcc dot gnu dot org 2009-03-06 13:36 ------- Confirmed with the reduced testcase only, at -O2 -Wall. The warning happens after PTA triggered by SRA.
Relevant constraints: __y_7 = &s.64+64 D.2839_21 = __y_7 __x.8_43 = D.2839_21 and code: D.2839_21 = &__y_7->D.2545; D.2832_22 ={v} &0B->D.2545; if (D.2832_22 != 0B) goto <bb 6>; else goto <bb 4>; <bb 4>: D.2888_42 = &__y_7->D.2545; if (D.2839_21 == D.2888_42) goto <bb 6>; else goto <bb 5>; <bb 5>: __x.8_43 = (const struct _Rb_tree_node *) D.2839_21; D.2878_45 = __x.8_43->_M_value_field; which shows that the warning is for dead code. Thus this is not a wrong-code problem. VRP could figure out the equivalencies but doesn't. The next DOM pass figures out the second but not the first non-equivalency - that survives until the next forwprop pass. In the end the problem is that VRP doesn't do a good job cleaning up after itself (there are single-argument PHIs left after it as well as non-simplified comparisons): <bb 3>: Invalid sum of incoming frequencies 900, should be 10000 # __y_8 = PHI <0B(2)> # __y_18 = PHI <__y_7(2)> ... <bb 4>: Invalid sum of incoming frequencies 3900, should be 102 D.2837 = 1; D.2839_21 = &__y_18->D.2545; D.2832_22 ={v} &0B->D.2545; if (D.2832_22 != 0B) goto <bb 8>; else goto <bb 5>; <bb 5>: D.2888_42 = &__y_7->D.2545; if (D.2839_21 == D.2888_42) goto <bb 8>; else goto <bb 6>; -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords|wrong-code |missed-optimization Last reconfirmed|0000-00-00 00:00:00 |2009-03-06 13:36:52 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39390