expand_builtin_printf, expand_builtin_fprintf, expand_builtin_sprintf and fold_builtin_sprintf presume that the host character set is compatible with the execution character set. They should use the target execution characters for '%', 'c', 's' and '\n'.
-- Summary: printf optimizations and non-ASCII character sets Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20109