https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118097
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED --- Comment #27 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Sam James from comment #26) > Reduced: > ``` > int a, b, c, *d = &a; > long e; > static long(am)(long f, int g) { return g == 0 || f == 1 && g == 1 ?: f / g; > } > static void aq(unsigned f) { > c ^= e = am(~f, 1); > b = 7 - (e >= 1) - 33; > *d = b; > } > int main() { > am(1, 1); > aq(1); > if (a == 0xffffffffffffffe5) > ; > else > __builtin_abort(); > } > ``` Yes it is the same as PR 118138, we have (long)(~1u) which is incorrectly sign extending. PR 118138 has a cleaner comment history so closing this one as a dup of that. *** This bug has been marked as a duplicate of bug 118138 ***