public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression
@ 2012-09-08 15:41 danglin at gcc dot gnu.org
  2012-09-08 20:49 ` [Bug preprocessor/54528] " danglin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-09-08 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54528
           Summary: [4.8 Regression] system.h:288:78: error: integer
                    overflow in expression
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa-unknown-linux-gnu
            Target: hppa-unknown-linux-gnu
             Build: hppa-unknown-linux-gnu


Created attachment 28153
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28153
Preprocessed source

/home/dave/gnu/gcc/objdir/./prev-gcc/g++
-B/home/dave/gnu/gcc/objdir/./prev-gcc/
 -B/home/dave/opt/gnu/gcc/gcc-4.8.0/hppa-linux-gnu/bin/ -nostdinc++
-B/home/dave
/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs
-B/home/dave/gnu/gcc/
objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/home/dave/gnu/gcc/obj
dir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu
-I/home/dave/gnu/gcc
/objdir/prev-hppa-linux-gnu/libstdc++-v3/include
-I/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++
-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/sr
c/.libs
-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.
libs -c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing
-W
write-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-W
no-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H 
-I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
-I../../gcc
/gcc/../libcpp/include  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libde
cnumber/dpd -I../libdecnumber    ../../gcc/gcc/mcf.c -o mcf.o
In file included from ../../gcc/gcc/mcf.c:47:0:
../../gcc/gcc/mcf.c: In function ‘void dump_fixup_edge(FILE*,
fixup_graph_type*, fixup_edge_p)’:
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:211:34: note: in expansion of macro 'CAP_INFINITY'
       if (fedge->max_capacity == CAP_INFINITY)
                                  ^
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:219:27: note: in expansion of macro 'CAP_INFINITY'
       if (fedge->rflow == CAP_INFINITY)
                           ^
../../gcc/gcc/mcf.c: In function ‘void create_fixup_graph(fixup_graph_type*)’:
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:531:28: note: in expansion of macro 'CAP_INFINITY'
                     fcost, CAP_INFINITY);
                            ^
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:543:23: note: in expansion of macro 'CAP_INFINITY'
                       CAP_INFINITY);
                       ^
../../gcc/gcc/mcf.c: In function ‘bool cancel_negative_cycle(fixup_graph_type*,
int*, gcov_type*, int*)’:
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:806:14: note: in expansion of macro 'CAP_INFINITY'
       d[i] = CAP_INFINITY;
              ^
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:822:34: note: in expansion of macro 'CAP_INFINITY'
             && d[pfedge->src] != CAP_INFINITY
                                  ^
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:845:32: note: in expansion of macro 'CAP_INFINITY'
           && d[pfedge->src] != CAP_INFINITY
                                ^
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:886:16: note: in expansion of macro 'CAP_INFINITY'
   cycle_flow = CAP_INFINITY;
                ^
../../gcc/gcc/mcf.c: In function ‘gcov_type find_max_flow(fixup_graph_type*,
int, int)’:
../../gcc/gcc/system.h:288:78: error: integer overflow in expression
[-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../gcc/gcc/mcf.c:1056:29: note: in expansion of macro 'CAP_INFINITY'
       gcov_type increment = CAP_INFINITY;
                             ^
cc1plus: all warnings being treated as errors
make[3]: *** [mcf.o] Error 1

dave@mx3210:~/gnu/gcc/objdir/prev-gcc$ ./xgcc -B./ -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: hppa-linux-gnu
Configured with: ../gcc/configure --with-gnu-as --with-gnu-ld --enable-shared
--enable-multiarch --with-multiarch-defaults=hppa-linux-gnu
--enable-linker-build-id --build=hppa-linux-gnu --host=hppa-linux-gnu
--target=hppa-linux-gnu --prefix=/home/dave/opt/gnu/gcc/gcc-4.8.0
--with-local-prefix=/home/dave/opt/gnu --enable-threads=posix
--enable-__cxa_atexit --build=hppa-linux-gnu --enable-clocale=gnu
--enable-java-gc=boehm --without-cloog --without-ppl
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada,lto
Thread model: posix
gcc version 4.8.0 20120908 (experimental) [trunk revision 191088] (GCC)


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
@ 2012-09-08 20:49 ` danglin at gcc dot gnu.org
  2012-09-10 10:28 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-09-08 20:49 UTC (permalink / raw)
  To: gcc-bugs

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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crowl at gcc dot gnu.org

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2012-09-08 20:49:37 UTC ---
Introduced in revision 191047 (change to new double_int interface).


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
  2012-09-08 20:49 ` [Bug preprocessor/54528] " danglin at gcc dot gnu.org
@ 2012-09-10 10:28 ` rguenth at gcc dot gnu.org
  2012-09-11  7:22 ` mikpe at it dot uu.se
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-10 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
  2012-09-08 20:49 ` [Bug preprocessor/54528] " danglin at gcc dot gnu.org
  2012-09-10 10:28 ` rguenth at gcc dot gnu.org
@ 2012-09-11  7:22 ` mikpe at it dot uu.se
  2012-09-12 15:48 ` kettenis at gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu.se @ 2012-09-11  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2012-09-11 07:21:57 UTC ---
I got these errors too, when trying to bootstrap gcc-4.8-20120909 on m68k-linux
using g++ 4.5.3 as the bootstrap compiler.


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-09-11  7:22 ` mikpe at it dot uu.se
@ 2012-09-12 15:48 ` kettenis at gnu dot org
  2012-09-13  0:44 ` danglin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kettenis at gnu dot org @ 2012-09-12 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mark Kettenis <kettenis at gnu dot org> 2012-09-12 15:48:34 UTC ---
Created attachment 28177
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28177
Patch that "fixes" the problem


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-09-12 15:48 ` kettenis at gnu dot org
@ 2012-09-13  0:44 ` danglin at gcc dot gnu.org
  2012-09-27  7:07 ` mikpe at it dot uu.se
  2012-09-27 11:46 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-09-13  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> 2012-09-13 00:44:15 UTC ---
(In reply to comment #3)
> Created attachment 28177 [details]
> Patch that "fixes" the problem

Works for me. I believe the problem is the overflow detection
in the new code.


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-09-13  0:44 ` danglin at gcc dot gnu.org
@ 2012-09-27  7:07 ` mikpe at it dot uu.se
  2012-09-27 11:46 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mikpe at it dot uu.se @ 2012-09-27  7:07 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> 2012-09-27 07:06:51 UTC ---
The bug is still present in gcc-4.8-20120923.


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

* [Bug preprocessor/54528] [4.8 Regression] system.h:288:78: error: integer overflow in expression
  2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-09-27  7:07 ` mikpe at it dot uu.se
@ 2012-09-27 11:46 ` danglin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-09-27 11:46 UTC (permalink / raw)
  To: gcc-bugs


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

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> 2012-09-27 11:45:49 UTC ---
Based on my testing, this was fixed by Lawrence's commit on
the 24th.  It added double_int::sub_with_overflow and
double_int::neg_with_overflow to fix the problem.


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

end of thread, other threads:[~2012-09-27 11:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-08 15:41 [Bug preprocessor/54528] New: [4.8 Regression] system.h:288:78: error: integer overflow in expression danglin at gcc dot gnu.org
2012-09-08 20:49 ` [Bug preprocessor/54528] " danglin at gcc dot gnu.org
2012-09-10 10:28 ` rguenth at gcc dot gnu.org
2012-09-11  7:22 ` mikpe at it dot uu.se
2012-09-12 15:48 ` kettenis at gnu dot org
2012-09-13  0:44 ` danglin at gcc dot gnu.org
2012-09-27  7:07 ` mikpe at it dot uu.se
2012-09-27 11:46 ` danglin at gcc dot gnu.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).