public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32628]  New: bogus integer overflow warning
@ 2007-07-04 23:31 ak at muc dot de
  2007-07-04 23:35 ` [Bug middle-end/32628] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ak at muc dot de @ 2007-07-04 23:31 UTC (permalink / raw)
  To: gcc-bugs

gcc version 4.3.0 20070704 (experimental)

Following test case derived from the Linux ACPI code warns

toverflow.c: In function 'f':
toverflow.c:8: warning: integer overflow in expression

but the warning is not correct because 0 + ULONG_MAX doesn't really overflow.

typedef void *acpi_handle;
typedef unsigned long long UINT64;
typedef unsigned long long acpi_native_uint;
typedef unsigned char u8;

int f(acpi_handle device)
{
        if (device == ((acpi_handle *) (void *) ((((u8 *) (void *) ((((void
*)0)))) + (acpi_native_uint)((UINT64)(~((UINT64) 0)))))))
                return 1;
        return 0;
}


-- 
           Summary: bogus integer overflow warning
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ak at muc dot de
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32628


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-04-13 15:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-04 23:31 [Bug c/32628] New: bogus integer overflow warning ak at muc dot de
2007-07-04 23:35 ` [Bug middle-end/32628] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-07-05 19:02 ` pinskia at gcc dot gnu dot org
2007-07-05 21:57 ` ebotcazou at gcc dot gnu dot org
2007-07-05 22:57 ` pinskia at gcc dot gnu dot org
2007-07-06  0:34 ` pinskia at gcc dot gnu dot org
2007-07-06  4:12 ` pinskia at gcc dot gnu dot org
2007-07-18 15:22 ` pinskia at gcc dot gnu dot org
2007-08-10  0:39 ` mmitchel at gcc dot gnu dot org
2008-01-15 15:03 ` rguenth at gcc dot gnu dot org
2008-01-16 22:11 ` rguenth at gcc dot gnu dot org
2008-01-16 22:20 ` rguenth at gcc dot gnu dot org
2010-04-13 15:48 ` ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).