https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81814
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2017-08-15 CC| |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- The folding obviously preserves precision changing casts, so it should be valid. Things must go wrong elsewhere, possibly in operand_equal_for_comparison_p which ends up using get_narrower.