https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107618
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Version|unknown |13.0 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Last reconfirmed| |2022-11-11 Keywords| |diagnostic Component|middle-end |tree-optimization Ever confirmed|0 |1 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- We diagnose because we see int main () { long int _2; <bb 2> [local count: 1073741824]: _2 = 0; if (_2 != 0) goto <bb 3>; [10.00%] else goto <bb 4>; [90.00%] <bb 3> [local count: 107374184]: a (); <bb 4> [local count: 1073741824]: return 0; } and the reason is that for some reason /* Copy propagation also copy-propagates constants, this is necessary to forward object-size and builtin folding results properly. */ NEXT_PASS (pass_copy_prop); doesn't work: --- a-t2.c.224t.strlen2 2022-11-11 08:44:14.044322291 +0100 +++ a-t2.c.225t.copyprop5 2022-11-11 08:44:14.044322291 +0100 ... <bb 2> [local count: 1073741824]: b_5 = __builtin_object_size (0B, 0); - _1 = 0; - _2 = (long int) _1; + _2 = 0; if (_2 != 0) goto <bb 3>; [10.00%] else I will have a look.