[Bug rtl-optimization/63396] New: signed integer overflows in loop-iv.c

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Sep 28 08:44:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63396

            Bug ID: 63396
           Summary: signed integer overflows in loop-iv.c
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

% g++ -w -O3 -fprofile-generate tramp3d-v4.cpp 
 % ./a.out --cartvis 1.0 0.0 --rhomin 1e-8 -n 20
 % g++ -w -O3 -fprofile-use tramp3d-v4.cpp
gcc/loop-iv.c:2305:24: runtime error: signed integer overflow:
9223372036854775807 - -9223372036854775808 cannot be represented in type 'long
int'
gcc/loop-iv.c:2643:14: runtime error: signed integer overflow:
9223372036854775806 - -9223372036854775808 cannot be represented in type 'long
int'

2303
2304   get_mode_bounds (desc->mode, desc->signed_p, desc->mode, &mmin, &mmax);
2305   nmax = INTVAL (mmax) - INTVAL (mmin);
2306

2635           inc = INTVAL (iv0.step) - INTVAL (iv1.step);
2636           if (CONST_INT_P (iv1.base))
2637             up = INTVAL (iv1.base);
2638           else
2639             up = INTVAL (mode_mmax) - inc;
2640           down = INTVAL (CONST_INT_P (iv0.base)
2641                          ? iv0.base
2642                          : mode_mmin);
2643           max = (up - down) / inc + 1;



More information about the Gcc-bugs mailing list