Hello, > Why is D.1476 not being propagated? IVOPTS introduces it, > but I don't see any reason why... > > Also, why all the leading zeros? Is there something special > about that constant? The initial RTL gcc produces for the > assignment to D.1476 is also suboptimal: > > ;; D.1476 = -000000001 > (insn 21 19 22 (set (reg:SI 64) > (const_int -1 [0xffffffffffffffff])) -1 (nil) > (nil)) > > (insn 22 21 0 (set (reg:SI 62 [ D.1476 ]) > (reg:SI 64)) -1 (nil) > (nil)) > > Strange... Does anyone know a reason for why this happens?
I think the constant has TREE_OVERFLOW set; and from mostly historical reasons optimizers are very conservative when dealing with such constants. There are two things that need to be done. The first is to check why ivopts produce the overflowed constant and fix that (ivopts should not produce unnecessary overflowed constants, since they are handled in a very conservative way in fold). The second one is to remove the restrictions (remove the check for TREE_OVERFLOW from is_gimple_min_invariant) and deal with the problems it exposes in tree -> rtl expansion. I think I will try the later fix today (mostly because I no longer remember what exactly were the problems that lead me to introducing the TREE_OVERFLOW check to is_gimple_min_invariant). Zdenek