This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/78681] [7 Regressions] ICE in determine_value_range, at tree-ssa-loop-niter.c:413


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We shouldn't ICE on this, but otherwise, garbage in, garbage out.  The
prototype doesn't match the K&R definition.

Slightly cleaned up testcase:

struct S { char b; };
char d, e, f, l, m;
struct S n;
int bar (char, char);
static void foo (struct S *, int, int, int, int);

static void
foo (x, g, h, i, j)
  struct S *x;
  char g, h, i, j;
{
  char k;
  for (k = 0; k <= j; k++)
    if (bar (g, k))
      for (; i; k++)
        if (d)
          x->b = g;
}

void
baz (int q)
{
  foo (&n, m, l, f, 1);
  foo (&n, m, e, f, e - 1);
}

It is enough if just one argument disagrees (e.g. the int vs. char on just j,
not all the others).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]