https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113692
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-01-31 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > My bet you could get the same error with: > _BitInt(129) i; > > void * > foo(void) > { > void *ret = 0; > ret = (void *)(__SIZETYPE__)(i & 1); > return ret; > } the above works. The question is there an extra cast in the IR between _BitInt and void* required or not? PHIOPT/match-and-simplify does: ``` phiopt match-simplify trying: _2 != 0 ? 1B : 0B Matching expression match.pd:2274, gimple-match-3.cc:23 Matching expression match.pd:2823, gimple-match-2.cc:35 Matching expression match.pd:2826, gimple-match-1.cc:66 Matching expression match.pd:2833, gimple-match-2.cc:96 Matching expression match.pd:2274, gimple-match-3.cc:23 Applying pattern match.pd:3396, gimple-match-6.cc:2527 Applying pattern match.pd:5327, gimple-match-9.cc:17991 phiopt match-simplify back: _5 = _2 != 0; _6 = (void *) _2; result: _6 ``` Notice how there is just cast a between _2 and `void*`.