[Bug tree-optimization/30306] New: printf->puts optimization prevented by %%

drepper at redhat dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 26 15:27:00 GMT 2006


If %% is used in printf formats without any actual format requiring
substitution being used, gcc still does not perform the optimization.

#include <stdio.h>
int
main (void)
{
  printf ("hello %%%%!\n");
  return  0;
}

This code is compiled to call printf even though it should lead to code calling
puts with the string containing "hello %%!".


-- 
           Summary: printf->puts optimization prevented by %%
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drepper at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30306



More information about the Gcc-bugs mailing list