https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72798
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> --- The difference comes from the (internal) implicit pure attribute. Without the print, the subroutine gets the pure attribute, so that its usage may be more aggressively optimized (Honestly, on a small test I made, there was actually no difference).