[Bug c/106333] New: Required condition omitted from generated code

2022-07-17 Thread eran.kornblau at kaltura dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333 Bug ID: 106333 Summary: Required condition omitted from generated code Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug c/106333] Required condition omitted from generated code

2022-07-17 Thread eran.kornblau at kaltura dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333 --- Comment #2 from Eran Kornblau --- Thanks Andreas, I understand there's an overflow here, but isn't it a bug that it affects the second part of the condition? I mean, any value is legit for the first part of the condition, if the behavior is

[Bug c/106333] Required condition omitted from generated code

2022-07-17 Thread eran.kornblau at kaltura dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333 --- Comment #4 from Eran Kornblau --- Ok, thank you both. One last point - maybe it makes sense to at least output a warning in this case? I added '-Wall -pedantic -Wextra' to the command, and didn't get any warning about this. The end result

[Bug c/106333] Required condition omitted from generated code

2022-07-17 Thread eran.kornblau at kaltura dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333 --- Comment #6 from Eran Kornblau --- Indeed! /tmp/x.c:18:44: runtime error: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long long int' Thanks! Eran