[Bug c/103950] printf("\xff") incorrectly optimized to putchar(-1)
admin@tho-otto.de
gcc-bugzilla@gcc.gnu.org
Sat Jan 8 17:16:12 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950
--- Comment #1 from Thorsten Otto <admin@tho-otto.de> ---
In gimple_fold_builtin_printf(), a call to printf() with a
single-character-string is optimized to putchar(). However that is also done
with non-ascii-characters, which in the case of printf("\ff") will call putchar
with a value of (-1) == EOF. That happens even if -funsigned-char is used.
More information about the Gcc-bugs
mailing list