https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81148
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> --- So were in "associate:", where lit0 = -123 lit1 = -1 which is associated to lit0 = -124 and var0 = null var1 = -((long int) ~(x != 0) ^ 9223372036854775806) which is associated to var0 = -((long int) ~(x != 0) ^ 9223372036854775806) Then 9765 con0 = associate_trees (loc, con0, lit0, code, atype); 9766 return 9767 fold_convert_loc (loc, type, associate_trees (loc, var0, con0, 9768 code, atype)); creates the bogus expression with overflow.