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

            Bug ID: 61943
           Summary: tree-ssa-loop-ivopts.c:4148 signed integer overflow
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com

// from pr55569.c
// gcc -O
// ../../gcc-4.9.1/gcc/tree-ssa-loop-ivopts.c:4148:24: runtime error: signed
integer overflow: 4 * 4611686018427387903 cannot be represented in type 'long
int'
// "offset = - ratio * int_cst_value (cbase);"
int *bar (void);

void
foo (void)
{
  long x;
  int *y = bar ();
    for (x = -1 / sizeof (int); x; --x, ++y)
       *y = 0;
}

Reply via email to