https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106711
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2022-08-22 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. I suspect what is happening is that GCC finds the strlen for each string seperately and sees its max is 4094 (because add) and does not take into account the strings are done together. _1 = strlen (in1_8(D)); _2 = strlen (in2_9(D)); _3 = _1 + _2; _4 = _3 + 2; if (_4 <= 4096) goto <bb 3>; [38.32%] else goto <bb 4>; [61.68%] <bb 3> [local count: 411457864]: sprintf (outbuf_10(D), "%s/%s", in1_8(D), in2_9(D));