[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 --- Comment #10 from Andrew Pinski --- Note the reason why the standard is written this way is because in K C, every function argument was promoted to int as there were no prototypes and then the function would cast it back to char/unsigned

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 --- Comment #9 from Andrew Pinski --- strchr has the same wording too: The strchr function locates the first occurrence of c (converted to a char ) in the string pointed to by s .

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|ASSIGNED

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 --- Comment #7 from Andrew Pinski --- (In reply to Thorsten Otto from comment #6) > A similar fix will be needed in gimple_fold_builtin_fputs Yes agreed. gimple_fold_builtin_strstr should do the same, though I don't know if it will matter but

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-10 Thread admin--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 --- Comment #6 from Thorsten Otto --- A similar fix will be needed in gimple_fold_builtin_fputs

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 Andrew Pinski changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-10 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 Richard Biener changed: What|Removed |Added Priority|P3 |P2

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 --- Comment #4 from Andrew Pinski --- >That happens even if -funsigned-char is used. Yes because in this case, GCC is using char internally and forgetting it is signed by default when calling a function as shown by my patch.

[Bug middle-end/103950] [9/10/11/12 Regression] printf("\xff") incorrectly optimized to putchar(-1)

2022-01-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103950 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |9.5 Summary|printf("\xff")