https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91625
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- What does the optimized dump look like for function equal_4_gs0_gs3_ga5_0? I see the same code with an hppa64-hp-hpux11.11 cross as with a native x86_64-linux compiler so I can't imagine what about it might cause the assertion to fail except the result returned from the library call: <bb 5> [local count: 1073741824]: # iftmp.2_2 = PHI <&gs0(2), &gs3(3), &ga5(4)> _1 = snprintf (0B, 0, "%s", iftmp.2_2); if (_1 != 4) goto <bb 6>; [0.04%] else goto <bb 7>; [99.96%] <bb 6> [local count: 429497]: __builtin_printf ("assertion failed on line %i: %s\n", 41, "snprintf (0, 0, \"%s\", p) == 4"); __builtin_abort (); What value does the function return at runtime?