[Bug 489204] New: gcc: unsigned overflow issues
https://bugzilla.novell.com/show_bug.cgi?id=489204
Summary: gcc: unsigned overflow issues
Classification: openSUSE
Product: openSUSE 11.2
Version: Factory
Platform: x86-64
OS/Version: Other
Status: NEW
Severity: Minor
Priority: P5 - None
Component: Development
AssignedTo: pth@novell.com
ReportedBy: sbrabec@novell.com
QAContact: qa@suse.de
Found By: ---
Suppose you have a simple C code below. It contains a naive overflow detection.
There is a warning:
overflow.c: In function ‘main’:
overflow.c:8: warning: assuming signed overflow does not occur when assuming
that (X + c) < X is always false
I am not sure, whether it is supposed to work, but there are at least warning
bugs:
1) The warning says "assuming signed overflow", but the variable is unsigned.
2) The overflow is optimized out for all -O* options, but the warning appears
only with -O>=2.
#include
https://bugzilla.novell.com/show_bug.cgi?id=489204
Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=489204
User rguenther@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=489204#c1
Richard Guenther
https://bugzilla.novell.com/show_bug.cgi?id=489204
User rguenther@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=489204#c2
--- Comment #2 from Richard Guenther
participants (1)
-
bugzilla_noreply@novell.com