[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2023-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 --- Comment #7 from Andrew Pinski --- This one still happens on the trunk even with PR 107465 fixed. The reason is because even though a warning here is correct, it is not wanted due to requiring constant folding. Note you can get also the incorr

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 --- Comment #6 from Marek Polacek --- (In reply to Manuel López-Ibáñez from comment #5) > http://gcc.gnu.org/ml/gcc/2013-11/msg00253.html Exactly. I hope I can tackle at least a part of it in next stage 1. > In those cases where folding helps t

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Comment

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 --- Comment #4 from Marek Polacek --- I believe we strive for the warnings be independent of the optimization level, but it's not always possible, we have tons of bugs where -Wuninitialized depends on the optimization level, sometimes -Warray-boun

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread chengniansun at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 --- Comment #3 from Chengnian Sun --- Thanks, Marek. May I ask another question on the Gcc optimizations and warnings? Is there a policy that the warnings should be independent of the optimization levels? That is, for all optimization levels, Gc

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 --- Comment #2 from Marek Polacek --- C++ folds while parsing and here for both -O0 -O we get y.c: In function ‘int fn1(unsigned char, unsigned char)’: y.c:3:18: warning: comparison of promoted ~unsigned with unsigned [-Wsign-compare] return (

[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

2014-02-06 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|