[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2023-06-29 Thread wolter.hellmundvega at tevva dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38341 wolter.hellmundvega at tevva dot com changed: What|Removed |Added CC||wolter.hellmundvega

[Bug c/38341] Wrong warning 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=38341 Andrew Pinski changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2016-03-10 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38341 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Commen

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2016-03-10 Thread daniele.alessandrelli at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38341 Daniele Alessandrelli changed: What|Removed |Added CC||daniele.alessandrelli@gmail

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2014-01-29 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38341 Georg-Johann Lay changed: What|Removed |Added Target|arm-elf-gcc |arm-elf-gcc,x86 Status|UNC

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2009-02-23 Thread michael dot malone at tait dot co dot nz
--- Comment #9 from michael dot malone at tait dot co dot nz 2009-02-24 00:43 --- I forgot to mention, if you assign to an intermediate variable, the warning also disappears which is the behaviour I would expect from an explicit cast. -- michael dot malone at tait dot co dot nz chan

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2009-02-23 Thread michael dot malone at tait dot co dot nz
--- Comment #8 from michael dot malone at tait dot co dot nz 2009-02-24 00:40 --- #ifdef UINT #include #define TYPE uint16_t #else #define TYPE unsigned short int #endif #define VALUE 0xFF int main(void); int main() { TYPE variable_a = ~VALUE; TYPE variable_b = VALUE;

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2009-02-23 Thread john dot carter at tait dot co dot nz
--- Comment #7 from john dot carter at tait dot co dot nz 2009-02-23 23:53 --- R Guenther said... > (int)u1 == (int)(u8_t)(~(int)u2) > > that we do not warn for the first case is because it is optimized to >u1 == ~u2 before. > > Why do you think the warning is incorrect? ---

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-02 Thread rguenth at gcc dot gnu dot org
--- Comment #6 from rguenth at gcc dot gnu dot org 2008-12-02 12:12 --- *** Bug 38370 has been marked as a duplicate of this bug. *** -- rguenth at gcc dot gnu dot org changed: What|Removed |Added ---

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-01 Thread fredrik dot hederstierna at securitas-direct dot com
--- Comment #5 from fredrik dot hederstierna at securitas-direct dot com 2008-12-01 13:35 --- On Intel i386-GCC (4.2.3) we just get warning only for the line if (c1 == ~c2) The other lines does not give warnings, so maybe its just the ARM-backend that catch this warning. I guess yo

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-01 Thread fredrik dot hederstierna at securitas-direct dot com
--- Comment #4 from fredrik dot hederstierna at securitas-direct dot com 2008-12-01 12:55 --- Heres another example, then I do not think the warnings are due to optimization. I have same warnings with both -O0 and -O3. #include typedef unsigned char u8_t; void test_cast(unsigned ch

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-01 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2008-12-01 12:49 --- As I said, for the first case we optimize away the promotions before the warning code comes along. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38341

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-01 Thread fredrik dot hederstierna at securitas-direct dot com
--- Comment #2 from fredrik dot hederstierna at securitas-direct dot com 2008-12-01 12:40 --- Then why dont we get warning on the first if-statement? Shouldnt these lines be equal? if (c1 == (unsigned char)(~c2)) { } if (u1 == (u8_t)(~u2)) { // THIS WILL GIVE WARNING } The fi

[Bug c/38341] Wrong warning comparison of promoted ~unsigned with unsigned

2008-12-01 Thread rguenth at gcc dot gnu dot org
--- Comment #1 from rguenth at gcc dot gnu dot org 2008-12-01 10:01 --- /* Warn if two unsigned values are being compared in a size larger than their original size, and one (and only one) is the result of a `~' operator. This comparison will always fail. Also warn if o